Search for Tips & Tricks

Google
 

Monday, May 23, 2011

How to join Two lines into one

If you want to join two lines into one from a file use the below command.

awk '{printf $0;printf " "}NR % 3 ==0 {print " "}' filename

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