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
Search for Tips & Tricks
Showing posts with label Bash. Show all posts
Showing posts with label Bash. Show all posts
Wednesday, February 27, 2008
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.
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.
Thursday, January 24, 2008
How to redirect output to a file and stdout simultaneously
# How to redirect to stdout and a file
grep 2>&1 | tee
e.g.
grep India *.txt 2>&1|tee output.log
grep
e.g.
grep India *.txt 2>&1|tee output.log
Wednesday, January 23, 2008
How to use find command to find and execute
Find can be clubbed with xargs for finding and executing commands.
e.g.
1. Find log fine in /var and delete them
$ find -path /var -name *.log -exec rm {} \;
e.g.
1. Find log fine in /var and delete them
$ find -path /var -name *.log -exec rm {} \;
Subscribe to:
Posts (Atom)