Commandline shortcuts

From NewbieDOC

Neo Phyte
(author)
Chris Lale
chrislale AT users DOT berlios DOT de (publisher)

Go to NewbieDOC index

Revision History


Revision 1.0 8th February 2006 Revised by Neo Phyte
Initial release.

Revision 1.1 22nd November 2007 Revised by Chris Lale
Modified to include Revision History, Abstract and Appendix for Licence, so that a stable version can be included in the "newbiedoc" package.

Revision 1.2 26th September 2009 Revised by Chris Lale
Updated for Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Commandline shortcuts


Abstract

Debian newbie help with tab completion, commandline history, copying and pasting text.


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)
nepomuk-rcgen       netcat              netstat
nepomukserver       netkit-ftp          newaliases
nepomukservicestub  netmon_applet       newbiedoc/
neqn                net.samba3          newgrp
net                 net-snmp-config     newrole


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/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.

(TAB)
syslog       syslog.1.gz  syslog.3.gz  syslog.5.gz  
syslog.0     syslog.2.gz  syslog.4.gz  syslog.6.gz 

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 position 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.

4 Appendix A: Licence

Copyright (c) 2006 Neo Phyte

Copyright (c) 2007-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.