Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wonder if there is any application for the linux bash shell to make it more easier to type.

E.g. if I type "c" then maybe it would give me all commands that starts with that letter for example "cd", "cp" etc. then if I type "cd" and press space it give me all the parameters for that command.

is there application of this kind to automatize command typing?

share|improve this question
up vote 3 down vote accepted

There already is such a feature built into bash. Type "c" and press tab. If nothing shows up it's cause it cannot add another letter since there are more options available. Press tab again and it will ask if you want a list of the available commands.

It works for parameters as well as long as the parameter in question is a file or folder name.

share|improve this answer
It works for program options as well, if you have bash-completion installed. and you can add your own completions. – Dennis Williamson Apr 3 '10 at 18:56
@dennis and @johan-skold. it doesnt work. ive installed bash_completion and ive started it in the shell. but when i type "apt-get up[TAB]" i get nothing. and im sure ive started it. – ajsie Apr 3 '10 at 19:56
Did you press Tab twice? – Dennis Williamson Apr 3 '10 at 21:32
@dennis. i pressed it 10 times=) im using ubuntu server btw – ajsie Apr 4 '10 at 8:26
@ajsie: What do these commands give you? echo $BASH_VERSION and bind -p | grep complet and shopt -p progcomp – Dennis Williamson Apr 4 '10 at 12:50

You may prefer setting the completion type to "menu-complete". In your ~/.inputrc file you can add a line that says "\C-i": menu-complete or at a Bash prompt, enter bind '"\C-i":menu-complete', then each time you press Tab, it will step through each possible completion.

Edit: fixed typo in bind command.

share|improve this answer
i have no problem with the completion itself. the problem lies in the nature of what words to complete my started letter. when i type eg. "aptitu" and then press TAB TAB it gives me "aptitude, aptitude-run-state-bundle and aptitude-create-state-bundle". when i have typed "aptitude " and then press TAB TAB it gives me the files in current directory. i want to be able to have all the aptitude's parameters listed: install, search, update and so on. is this possible? – ajsie Apr 5 '10 at 10:34
@ajsie: When I type "aptitu[TAB][TAB]" it completes to "aptitude", then I press [space][TAB][TAB] then it gives me a list of aptitude commands, such as autoclean, build-dep, changelog, etc. Then I press "i[TAB][TAB]" and now I have aptitude install. – Dennis Williamson Apr 5 '10 at 13:26
@ajsie: However, with menu-complete, I type "apti[TAB]" (one [TAB]) and get "aptitude", then I press space (now there are two spaces, one was provided by the completion) and [TAB]. Now I see "aptitude autoclean". Then each time I press [TAB] it cycles through the commands. If instead of the space, I had typed "c" then pressed [TAB] it would cycle between "changelog" and "clean". (By the way, sorry for the typo in my original answer. I've fixed it. Perhaps my error caused it not to work for you.) – Dennis Williamson Apr 5 '10 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .