Shell tab-completion and other helpful command-line tricks
jonorland at gmail.com
Thu Jan 29 21:09:03 GMT 2009
2009/1/23 Paul Rumelhart <godshatter at yahoo.com>:
> I hope you find this helpful, and if you know of any cute tab-completion
> tricks please let us know. If you use the command-line a lot, you'll
> find that pressing the tab key becomes instinctive and you'll really
> miss it when you are in a program that doesn't use it.
One thing i use all the time with bash is the command history and the
readline shortcuts. So here is some of my most used shortcuts.
Arrow up or CTRL+P will fetch the previous command from the history.
Arrow down or CTRL+N will fetch the next command from the history.
CTRL+R will reverse search history for what ever you enter. Greate for
fetching that complicated command you wrote some days ago but dont
CTRL+A move to beginning of line.
CTRL+E move to end of line.
ALT+F move forward a word.
ALT+B move back a word.
CTRL+L clear screen.
CTRL+k remove the text from the cursor to the end of the line.
CTRL+X BACKSPACE remove text from the cursor to the beginning of the line.
ALT+D delete a word forward.
ALT+BACKSPACE delete a word backwards.
And there is more shortcuts in the readline library like copy and
paste that could help a lot when working in the shell.
More information about the kubuntu-users