11 Bonus – Command Line Kung Fu

 

. /etc/bash_completion

 

 

enable globally

sudo vi /etc/bash.basrc

 

sudo !!  < —  remember most recent command

Rerun a Command Starting with String

Rerun a Command Starting with String

 

cd /mnt/data/restore

user@computer:~$ vi file1 file2 file3
3 files to edit
user@computer:~$ cat !*
cat file1 file2 file3
this if file on1e
this is file 2
this if file 3
user@computer:~$ mv !* /tmp/
mv file1 file2 file3 /tmp/

 

|  in regular expression mean OR

grep -Ev ‘^#|^$’ file.txt

 

006 Reuse the last item from the previous command

006 Reuse the last item from the previous command