Working at shell prompt is an essential task for any Linux system administration. However many newcomers find it difficult to work at bash prompt. Here are some tricks to speed up your work.
(A) Shortcut keys for command editing:
CTRL+L : Clear the screen
CTRL+R : To search for a command in command history. For example yesterday or few hourse back you typed 'a very very long command' and you need same command again. Then hit CTRL+R and type first few letters of command.
CTRL+C : Cancel command
CTRL+Z : Suspend command
CTRL+T : transpose characters. For example by misspelled command date:
$ daet
Sure you can rub the last two character and retype it again, but wait just hist CTRL+T and you are done:
$ daet [CTRL+T]
Result into character transpose:
$ date
ALT+T OR ESC+T: transpose words. For example you typed:
$ filename rm
To correct it just hit ALT+T
$ filename rm [ALT+T]
And you have correct command to remove a file.
$ rm filename
CTRL+U : Deletes entire line
CTRL+K : Deletes to end of line from current cursor position
HOME OR CTRL+A : Moves cursor to beginning of line
END OR CTRL+E : Moves cursor to end of line
(B)Recall last argument from previous command – to save time
ALT+. (hold down ALT key and press period/dot)
For example first you typed the mkdir command as follows:
$ mkdir -p /tmp/demo/software/qtapp
Now you would like change directory to /tmp/demo/software/qtapp, then type cd and press ALT+.:
$ cd [PRESS alt+.]
(C) Command completion
Most of the Linux admin uses TAB key to complete command names and files names. So let us say you would like to mount something then:
i) Type word mo:
$ mo
ii) Hit TAB key to complete word
$ mo [TAB]
iii) And end result should be:
$ mount
(D) List the possible completions
BASH also supports the possible completions of commands or text (file). For example you would like to list all the possible command starts with ls command:
$ ls [ESC]
Will display following text (above the current command line)
ls lsmod lsmod.modutils lspci lsusb lsattr lsmod.Lmodutils lsof
Next time I will discuss more about advanced command line completions and other cool features.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins

- My 10 UNIX Command Line Mistakes
- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
Facebook it - Tweet it - Print it -
We're here to help you make the most of sysadmin work. So, subscribe!

{ 2 comments… read them below or add one }
Hmm that is cool, you can also read more shortcut keys in bash man page.
A thing to amend:
“CTRL-U : Deletes entire line”
No, CTRL-U Deletes from current cursor position to beginning of line (the opposite of CTRL-K)