Search for Tips & Tricks

Google
 

Wednesday, February 27, 2008

Bash command line key bindings

Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + t - swapping of the last two char
Ctrl + u - Delete backward from cursor
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command
Ctrl + / - Undo last command-line edit
Ctrl + P - Previous command line
Ctrl + N - Next command line (useful for "scrolling" with Ctrl+P)
Ctrl + H - Backspace

How to get the screen resolution

# how to get the screen resolution
$ xdpyinfo

How to iterate through output

# use this below script for iteration thorugh the output

for i in *.tar.gz; do echo working on $i; tar xvzf $i ; done

the above example will extract all tar.gz file in current folder.