Thursday, April 27, 2017

Alan Skorkin's Treasure Trove (Bash Shortcuts)

http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

The ones I didn't know about :

Ctrl + k - delete from cursor to end of command line
Ctrl + u - delete from cursor to start of command line
Ctrl + w - delete backwards one word
Ctrl + y - paste text victimized by most recent deletion
Ctrl + xx - move between start of command line and current cursor position
Alt + b/f - back/forward one word
Alt + d - delete to end of word
Alt + c - capitalize start of word and go to end of word
Alt + u - make uppercase from cursor to end of word
Alt + l - make lowercase from cursor to end of word
Alt + t - swap current word with previous (SO COOL!)
Alt + . - insert last word of previous command

!blah:p - print out the command that !blah would run and add it to history
!* - previous command except for the FIRST word (even geniuses get it wrong sometimes :)
!!:s/foo/bar - execute previous command by replacing foo with bar

And, nuggets from Linux Foundation's EDX course : http://tersamgt.blogspot.com/2015/01/almost-20-years-with-unix-mann-kann.html

No comments: