Skip to content

Commit 12feabb

Browse files
updated dot files, resource links and descriptions
1 parent 0465b22 commit 12feabb

7 files changed

Lines changed: 156 additions & 197 deletions

File tree

.bash_aliases

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ a s='du -sh * | sort -h'
3131
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
3232
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
3333
# short-cut to grep that file
34-
a slg='< ~/.command_examples.txt grep'
34+
a slg='< ~/.saved_commands.txt grep'
3535

3636
# change ascii alphabets to unicode bold characters
3737
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/𝗮-𝘇𝗔-𝗭/'"
@@ -45,6 +45,10 @@ ch() { whatis $1; man $1 | sed -n "/^\s*$2/,/^$/p" ; }
4545
# usage: ap file1 file2 etc
4646
ap() { for f in "$@"; do echo "$PWD/$f"; done; }
4747

48+
# simple case-insensitive file search based on name
49+
# remove '-type f' if you want to match directories as well
50+
fs() { find -type f -iname '*'"$@"'*' ; }
51+
4852
# open files with default application, don't print output/error messages
4953
# useful for opening docs, pdfs, images, etc from command line
5054
o() { gnome-open "$@" &> /dev/null ; }

.bashrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ shopt -s histappend
99
# Update window size after every command
1010
shopt -s checkwinsize
1111

12+
# If set, the pattern "**" used in a pathname expansion context will
13+
# match all files and zero or more directories and subdirectories.
14+
shopt -s globstar
15+
# extended globs, see https://mywiki.wooledge.org/glob#Options_which_change_globbing_behavior
16+
#shopt -s extglob
17+
18+
# color man page in vim
19+
#export MANPAGER='env MAN_PN=1 vim --not-a-term -M +MANPAGER -'
20+
1221
# source aliases
1322
if [ -f ~/.bash_aliases ]; then
1423
source ~/.bash_aliases
@@ -18,8 +27,10 @@ fi
1827
#INPUTRC=~/.inputrc
1928

2029
# set a simple prompt
21-
# check out http://bashrcgenerator.com/ to generate fancy and colorful prompt
2230
PS1='$ '
31+
# see https://starship.rs/ minimal, blazing-fast, and infinitely customizable prompt
32+
# also check out http://bashrcgenerator.com/ to generate fancy and colorful prompt
33+
# https://wiki.archlinux.org/index.php/Bash/Prompt_customization
2334

2435
# further reading
2536
# https://github.com/mrzool/bash-sensible/blob/master/sensible.bash

.inputrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ set show-all-if-ambiguous on
1313
set echo-control-characters off
1414

1515
# further reading
16-
# http://www.gnu.org/software/bash/manual/html_node/Sample-Init-File.html#Sample-Init-File
17-
# http://www.linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html
16+
# https://www.gnu.org/software/bash/manual/html_node/Sample-Init-File.html#Sample-Init-File
17+
# https://wiki.archlinux.org/index.php/readline

.vimrc

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
" tested on Vim version 7.4, some mappings work in gvim only
1+
" tested on Vim version 8, some mappings work in gvim only
2+
" see also: https://github.com/vim/vim/blob/master/runtime/defaults.vim
3+
set nocompatible
4+
set backspace=indent,eol,start
5+
set ruler
6+
" Ctrl-A and Ctrl-X won't treat number with leading zeros as octal
7+
set nrformats-=octal
8+
29

310
" ----- General Settings -----
411
" history limit
@@ -7,11 +14,15 @@ set history=500
714
set nobackup
815
" Don't create swap files
916
set noswapfile
10-
" Dark theme
11-
colorscheme murphy
17+
" murphy is another theme I like
18+
colorscheme peachpuff
1219
" show partial Normal mode command as they are typed on Command Line
1320
" show character/line/block selection in Visual mode on Command Line
1421
set showcmd
22+
" some vulnerability
23+
set nomodeline
24+
" syntax
25+
syn on
1526

1627
" first tab hit will complete as much as possible
1728
" second tab hit will provide a list
@@ -57,7 +68,7 @@ nnoremap <silent> <Space> :noh<CR><Space>
5768
" Map F2 key to save file in command mode
5869
nnoremap #2 :w<CR>
5970
" Map F2 key to save file in insert mode
60-
inoremap <F2> <Esc>:w<CR>a
71+
inoremap <F2> <C-o>:w<CR>
6172
" Map F3 key to save and quit file in command mode
6273
nnoremap #3 :wq<CR>
6374
" Map F4 key to clear file contents in command mode
@@ -72,8 +83,6 @@ nnoremap <A-3> 3gt
7283
nnoremap <A-4> 4gt
7384
nnoremap <A-5> 5gt
7485
75-
" Map F2 key to save file in insert mode
76-
inoremap <F2> <C-o>:w<CR>
7786
" Ctrl+e to move to end of word
7887
inoremap <C-e> <Esc>ea
7988
" Ctrl+b to move to beginning of word
@@ -98,8 +107,6 @@ inoremap <C-l> <C-x><C-l>
98107
" use strict;
99108
" use warnings;
100109
inoreabbrev p #!/usr/bin/perl<CR>use strict;<CR>use warnings;<CR>
101-
" py2 for python
102-
inoreabbrev py2 #!/usr/bin/python
103110
" py for python3
104111
inoreabbrev py #!/usr/bin/python3
105112
" auto correct teh as the
@@ -140,7 +147,7 @@ set suffixesadd+=.v,.V,.sv,.SV
140147
" gvim customization - no menubar/Toolbar, set font and size
141148
set guioptions-=m
142149
set guioptions-=T
143-
set guifont=Monospace\ 12
150+
set guifont=Monospace\ 14
144151

145152

146153
" Other useful vimrcs and links

Linux_curated_resources.md

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
Handful of useful resources for Linux command line and bash shell scripting
1+
# Linux CLI and Shell scripting
22

3-
Guide to choosing your Linux Distribution, list of applications, etc: [awesome-linux](https://github.com/aleksandar-todorovic/awesome-linux#distributions) and [computefreely](https://computefreely.org/)
3+
Collection of resources for Linux command line, shell scripting (mostly `bash`) and a few on topics like Linux Kernel, distributions, applications, etc.
44

5-
# :hash: Table of Contents
6-
7-
* [Courses: online text tutorials](#course-text)
8-
* [Courses: online video/interactive tutorials](#course-interactive)
9-
* [Shell Scripting](#shell-scripting)
10-
* [Scripting companion](#scripting-companion)
11-
* [Books](#books)
12-
* [Tips and Tricks](#tips-and-tricks)
13-
* [Resources for specific commands](#specific-commands)
14-
* [Text and File processing](#text-file-processing)
15-
* [Miscellaneous](#miscellaneous)
16-
* [Further Reading](#further-reading)
17-
* [Forums](#forums)
18-
19-
<br>
20-
21-
# <a name="course-text"></a>Courses: online text tutorials
5+
## CLI text tutorials
226

237
* [ryanstutorial](https://ryanstutorials.net/linuxtutorial/)
248
* [Bash Guide](https://mywiki.wooledge.org/BashGuide)
@@ -28,21 +12,17 @@ Guide to choosing your Linux Distribution, list of applications, etc: [awesome-l
2812
* [linux basics](https://miteshshah.github.io/linux/basics/)
2913
* [learnenough](https://www.learnenough.com/command-line-tutorial/basics)
3014

31-
<br>
32-
33-
# <a name="course-interactive"></a>Courses: online video/interactive tutorials
15+
## CLI video and interactive courses
3416

3517
* [linuxjourney](https://linuxjourney.com/)
3618
* [MIT: The Missing Semester of Your CS Education](https://missing.csail.mit.edu/) — master the command-line, use a powerful text editor, use fancy features of version control systems, and much more
3719
* [udacity](https://www.udacity.com/course/linux-command-line-basics--ud595)
3820
* [edx](https://www.edx.org/course/introduction-to-linux)
3921
* [memrise](https://www.memrise.com/course/50252/shell-fu/)
4022
* [shortcutfoo](https://www.shortcutfoo.com/app/dojos/command-line)
41-
* [youtube — command line basics](https://www.youtube.com/watch?v=bE9DyH43C2I&list=PLVqGqrTs4ZWOhcApSWYIX_rnPMZDAClJa)
42-
43-
<br>
23+
* [youtube: command line basics](https://www.youtube.com/watch?v=bE9DyH43C2I&list=PLVqGqrTs4ZWOhcApSWYIX_rnPMZDAClJa)
4424

45-
# <a name="shell-scripting"></a>Shell Scripting
25+
## Shell Scripting
4626

4727
* [Bash Guide](https://mywiki.wooledge.org/BashGuide)
4828
* [ryanstutorial](https://ryanstutorials.net/bash-scripting-tutorial/)
@@ -53,42 +33,42 @@ Guide to choosing your Linux Distribution, list of applications, etc: [awesome-l
5333
* [bash shell scripting](https://en.wikibooks.org/wiki/Bash_Shell_Scripting)
5434
* [Serious Shell Programming](https://freebsdfrau.gitbook.io/serious-shell-programming/) — focuses on POSIX-compliant Bourne Shell for portability
5535

56-
### <a name="scripting-companion"></a>Scripting companion
36+
### Scripting companion
5737

5838
* [shellcheck](https://www.shellcheck.net/) — linting tool to avoid common mistakes and improve your script
59-
* [bash FAQ](https://mywiki.wooledge.org/BashFAQ), [bash Practices](https://mywiki.wooledge.org/BashGuide/Practices) and [bash pitfalls](https://mywiki.wooledge.org/BashPitfalls) — comprehensive lists
39+
* Comprehensive lists on `mywiki.wooledge.org` website:
40+
* [bash FAQ](https://mywiki.wooledge.org/BashFAQ)
41+
* [bash Practices](https://mywiki.wooledge.org/BashGuide/Practices)
42+
* [bash pitfalls](https://mywiki.wooledge.org/BashPitfalls)
6043
* [Google shell style guide](https://google.github.io/styleguide/shell.xml)
61-
* tips for [safe ways to do things in bash](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md) and [better scripting](https://robertmuth.blogspot.in/2012/08/better-bash-scripting-in-15-minutes.html) and [robust scripting](https://www.davidpashley.com/articles/writing-robust-shell-scripts/)
62-
* [bash reference](https://devmanual.gentoo.org/tools-reference/bash/index.html) — nicely formatted and explained well
44+
* Reliability and robustness
45+
* [safe ways to do things in bash](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md)
46+
* [better scripting](https://robertmuth.blogspot.in/2012/08/better-bash-scripting-in-15-minutes.html)
47+
* [robust scripting](https://www.davidpashley.com/articles/writing-robust-shell-scripts/)
48+
* [bash reference cheatsheet](https://devmanual.gentoo.org/tools-reference/bash/index.html) — nicely formatted and explained well
6349

64-
<br>
65-
66-
# <a name="books"></a>Books
50+
## Books
6751

6852
* [Bash Guide](https://mywiki.wooledge.org/BashGuide)
6953
* [The Linux Command Line](https://linuxcommand.org/tlcl.php)
7054
* [Unix for beginning Mage](http://unixmages.com/wp-content/uploads/2018/12/ufbm.pdf)
7155
* [Linux kernel and its insides](https://0xax.gitbooks.io/linux-insides/content/index.html)
7256

73-
<br>
74-
75-
# <a name="tips-and-tricks"></a>Tips and Tricks
57+
## Tips and Tricks
7658

7759
* [art of command line](https://github.com/jlevy/the-art-of-command-line)
7860
* [command line tricks](https://stackoverflow.com/questions/68372/what-is-your-single-most-favorite-command-line-trick-using-bash)
7961
* [explainshell](https://explainshell.com/) — write down a command-line to see the help text that matches each argument
8062
* [commandlinefu](https://www.commandlinefu.com/commands/browse/sort-by-votes) — also explore different tags like awk, grep, sed, etc
8163
* [tldr](https://tldr.sh/) — Simplified and community-driven man pages
8264

83-
<br>
84-
85-
# <a name="specific-commands"></a>Resources for specific commands
65+
## Resources for specific commands
8666

8767
* [Linux Commands In Structured Order](https://linoxide.com/guide/linux-command-shelf.html)
8868
* [discussion on useful Linux commands](https://www.reddit.com/r/linuxadmin/comments/1x0ql2/whats_a_linux_command_you_wish_you_had_known/)
8969
* [general purpose command line tools](http://www.compciv.org/unix-tools/)
9070

91-
### <a name="text-file-processing"></a>Text and File processing
71+
### Text and File processing
9272

9373
* [My example based tutorial for various cli text processing tools](https://github.com/learnbyexample/Command-line-text-processing)
9474
* [All about replacing strings in file(s)](https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files)
@@ -121,40 +101,37 @@ Guide to choosing your Linux Distribution, list of applications, etc: [awesome-l
121101
* [alvinalexander](https://alvinalexander.com/unix/edu/examples/find.shtml)
122102
* [conqueringthecommandline](http://conqueringthecommandline.com/book/find)
123103

124-
### <a name="miscellaneous"></a>Miscellaneous
104+
### Miscellaneous
125105

126106
* [Unix and Linux Permissions Primer](https://danielmiessler.com/study/unixlinux_permissions/)
127107
* [Linux Permissions Primer Part I](https://archive.is/2CSlT) — archive copy of catchlinux website
128108
* [rsync](https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps)
129109
* [htop](https://peteris.rocks/blog/htop/) — detailed tutorial
130110
* [crontab examples](https://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/)
131111

132-
<br>
133-
134-
# <a name="further-reading"></a>Further Reading
112+
## Further Reading
135113

136114
* [Unix as IDE](https://sanctum.geek.nz/arabesque/series/unix-as-ide/)
137115
* [command line Q&A](https://unix.stackexchange.com/questions/tagged/command-line?sort=votes&pageSize=15)
138-
* [learn-anything linux](https://learn-anything.xyz/operating-systems/unix/linux)
116+
* [learn-anything: linux](https://learn-anything.xyz/operating-systems/unix/linux)
139117
* [awesome linux resources](https://github.com/itech001/awesome-linux-resources)
140118
* [awesome shell resources](https://github.com/alebcay/awesome-shell) and [awesome bash](https://github.com/awesome-lists/awesome-bash)
141119
* [bash hackers wiki](https://wiki.bash-hackers.org/start)
142120
* [stronger shell](https://m.odul.us/blog/2015/8/12/stronger-shell) — learnings from Matt Bowen and list of resources
143121
* [bash env variables](https://www.tricksofthetrades.net/2015/06/14/notes-bash-env-variables/)
122+
* Guide to choosing your Linux Distribution, list of applications, etc:
123+
* [awesome-linux](https://github.com/aleksandar-todorovic/awesome-linux#distributions)
124+
* [computefreely](https://computefreely.org/)
144125
* Application lists — for audio, video, graphics & design, development, games etc
145126
* [arch wiki](https://wiki.archlinux.org/index.php/List_of_applications)
146127
* [alternativeto](https://alternativeto.net/)
147128
* [GNU packages](https://www.gnu.org/manual/manual.html)
148-
* [youtube-dl](https://github.com/rg3/youtube-dl/)
149-
* [qutebrowser](https://qutebrowser.org/)
150129
* Linux/Bash on Windows
151130
* [git-bash](https://gitforwindows.org/)
152131
* [cygwin](https://www.cygwin.com/)
153-
* [Linux Subsystem for Windows by Microsoft](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
154-
155-
<br>
132+
* [Linux Subsystem for Windows](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
156133

157-
# <a name="forums"></a>Forums
134+
## Forums
158135

159136
Read instructions provided by respective forums before asking a question. Try solving it yourself before asking — searching online, manual, ask a colleague, etc.
160137

0 commit comments

Comments
 (0)