Sunday, July 11, 2010

bash shortcuts quick reference

http://www.ice2o.com/bash_quick_ref.html

Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Ctrl-b Move back one character.
Alt-b Move back one word.
Ctrl-f Move forward one character.
Alt-f Move forward one word. (not work in terminal window; use ctrl-right arrow instead)
Ctrl-] x Where x is any character, moves the cursor forward to the next occurance of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurance of x.

Ctrl-l Clear the screen leaving the current line at the top of the screen.
Ctrl-u Delete from the cursor to the beginning of the line.
Ctrl-k Delete from the cursor to the end of the line.
Ctrl-w Delete from the cursor to the start of the word.
alt-d Delete from the cursor to the end of the word.

Alt-r Undo all changes to the line.
Alt-Ctrl-e Expand command line.
Ctrl-y Pastes text from the clipboard.
Ctrl--/+ change font sizes

!! Execute last command in history
!abc Execute last command in history beginning with abc
!abc:p Print last command in history beginning with abc
!n Execute nth command in history
!^ First argument of last command
!$ Last argument of last command
^abc^xyz Replace first occurance of abc with xyz in last command and execute it

alt-u uppercase word
alt-l lowercase word
alt-c capitalize word

my side-by-side folders comparison before winmerge in linux

diff ~/regex /media/window/regex -rq | grep differ$ | cut -d' ' -f 2,4 | while read a b; do sdiff $a $b; done | more

gvim -d a b

backup subfolders

#create directory path
mkdir –p temp/a/b/c

#copy (update) files in path
cp –ufrp src dest
#update only, forcefully, recursive, preserve permission

#compare two directories
diff –rq abc def
#recursive, quick (file names only)

#subversion release
svn copy –r 797 svn://abc/trunk/def svn://abc/tags/def_r797 –m “release beta 5”