Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 :-)

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
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. –  grawity Oct 2 '09 at 20:00
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.