2

Is there a Linux shell that will let you type less than full commands as you can with Cisco IOS, at least for the first command (and not its arguments)?

I haven't really thought enough if this is actually a good thing, but might be fun to play with :-)

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444

3 Answers3

2

Almost all UNIX shells do tab completion by default. If you want shorter equivalent commands just create an alias for the ones you use commonly.

The problem with tab completion is that there are so many commands in UNIX that you tend to need to type in many more characters than you would in IOS before the command prefix becomes unambiguous.

FWIW, on my tcsh setup, typing tel<tab> offers me telinit, telltc and telnet. Only once I type n does it them autocomplete to the latter of those.

Furthermore, some shells can then offer you command line arguments too, so long as it has been told in advance which arguments are valid for the current program.

Alnitak
  • 20,901
  • 3
  • 48
  • 81
  • `bash` can do the same completion too, including command line arguments (for most popular commands). In most Linux distributions, you can get that by installing `bash-completion`. – user1686 Oct 02 '09 at 20:00
0

bash also allows tab autocompletion for arbitrary data sets (called Programmable Bash Completion), most usefully for SSH hostnames. Grab /etc/bash_completion from http://www.caliban.org/bash/index.shtml#completion and source it at login.

Troy Davis
  • 191
  • 4
0

No, I do not know of such as shell. However, you can get close to what you probably want with tab-completion (type in part of a command and hit the <Tab> key, and the shell will try to complete the command from what you gave it.

Also, you can define command aliases using the shell builtin alias, like so:

alias ll='ls -l'

Which will replace the command ll with ls -l whenever you type it afterwards.

Silas Snider
  • 148
  • 5