Commandline shortcuts
From NewbieDOC
Neo Phyte 10:16, 8 February 2006 (CET)
Contents |
1 Tab completion
1.1 Commands
At the prompt, press the TAB key (twice if you get a beep) for a list of all possible commands.
$ (TAB BEEP TAB) Display all 2177 possibilities? (y or n)
At the prompt, start typing a command, then press TAB after the first few letters. If several commands start with those letters, you get a list of all the commands.
$ ne (TAB BEEP TAB) neotoppm net netmon_applet network-admin newgrp neqn netkit-ftp netstat newaliases nex
If only one command starts with those letters, the whole command is inserted on the command line.
$ nets (TAB) $ netstat
1.2 Paths
Start typing the path, then press TAB to complete part of the path (if there is more than one possibility) or the whole path (if it is unique).
# tail /va (TAB) # tail /var/ # tail /var/lo (TAB BEEP TAB) local lock log # tail /var/lo # tail /var/log/sy (TAB) # tail /var/log/syslog (BEEP)
The final BEEP indicates that there are more possibilities. Press TAB again to see what they are.
2 Commandline history
At the prompt, navigate through previous commands you have issued using the UP ARROW and DOWN ARROW keys. For instance, if the previous two commands were nano
and ls
:
$ (UP ARROW) $ ls $ ls (UP ARROW) $ nano $ nano (DOWN ARROW) $ ls
3 Copy and paste
If you are using a terminal window in X, highlight text in the terminal (or anywhere else) using the mouse. Click to postition the insertion point anywhere on the command line and paste with the middle mouse button. Alternatively use SHIFT-CTRL-C to copy and SHIFT-CTRL-V to paste.
Content is available under GNU Free Documentation License 1.2, unless otherwise stated.