A feature provided by interactive programs such as shells and text editors that inserts text to complete a word or phrase that the user is likely intending to compose.

learn more… | top users | synonyms (2)

25
votes
2answers
15k views

An easy bash completion tutorial? [closed]

I want to learn how to write bash completion scripts. Which tutorial would you recommend for a newbie?
3
votes
4answers
452 views

How to set proper monitoring of my services in a automated way? So that if one crash it auto on the fly restarts?

How can i setup monitoring to my system services? Either using automated script which scan every moment, if httpd, mysqld, and my custom daemon is running or not, if not running it will automatically ...
3
votes
1answer
905 views

zsh equivalent of bash show-all-if-ambiguous?

In bash, if you hit tab when there are multiple possible completions you get a list of matches that keeps reprinting if you repeatedly press tab. In tcsh, setting autocomplete to enhanced also ...
19
votes
1answer
3k views

How do I get bash completion for command aliases?

I am looking to get tab-completion on my command line aliases, for example, say I defined the following alias : alias apt-inst='sudo aptitude install' Is there a way to get the completions ...
20
votes
4answers
8k views

Command-line completion from command history

So, I've looked at history and at Ctrl+R, but they are not what I thought I knew. Is there a way that I can type in the beginning of a command, and cycle through the matches in my history with some ...
9
votes
3answers
700 views

How to pipe the list of commands displayed by of “tab complete”?

When using commands in bash I like the double tab option to display the available commands. Some commands have more possible matches than others: Is there a way I can pipe the output of the double ...
5
votes
1answer
1k views

Autocomplete of filename in directory

This question is quite similar to this one, but I can't understand the solution. I also know this tutorial, but still I am unable to understand what I am doing wrong. I am trying to autocomplete the ...
4
votes
3answers
5k views

Bash Auto-Completion feature for SSHing into Different Hosts

I have big list of servers which I normally ssh to all the time. Is there any way using bash or zsh so that I can keep the list of hostname and bash auto-completion goes through the file and gives me ...
4
votes
3answers
2k views

How can I expand a relative path at the command line, with tab completion?

In bash is there any way to expand a relative path into an absolute path, perhaps with tab completion? I ask because sometimes I will search for a file, find it, then vim it: cd /etc cd apache2 cd ...
37
votes
2answers
5k views

Rebuild auto-complete index (or whatever it's called) and binaries in $PATH cache in zsh

After installing new software, an already opened terminal with zsh won't know about the new commands and cannot generate auto-complete for those. Apparently opening a new terminal fix the problem, but ...
11
votes
1answer
3k views

Terminal autocomplete: cycle through suggestions

I had this on my Ubuntu setup and since I switched to Fedora I want to set it and I forgot how... The idea is simple : I don't want the terminal to show me suggestions when I double tab, instead I ...
20
votes
3answers
2k views

How does TAB auto-complete find options to complete?

And how does it also autocomplete aliases?
10
votes
5answers
2k views

Weird Stuff in Terminal When I Hit Tab

For some reason, today, everytime I hit tab in the terminal this shows up: cat bash: warning: setlocale: LC_CTYPE: cannot change locale (en_CA) Display all 150 possibilities? (y or n) This ...
8
votes
1answer
3k views

How to specify a custom autocomplete for specific commands? [duplicate]

Is there a way to have bash know exactly what to display when you double tab? For example I have a python script scpy which requires a couple arguments. For example like apt-get, if you double tab ...
13
votes
3answers
884 views

How to eliminate annoyances when starting a GUI from a terminal?

I prefer to launch GUI applications from a terminal window rather than by using a graphical desktop. A frequent annoyance is that often the developers haven't anticipated this type of use, so the app ...
7
votes
1answer
385 views

How to output string completions to stdout?

Some of the git commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the TAB width in git-gui, but ...
5
votes
3answers
550 views

Custom autocomplete: deal with spaces in filenames

A bit of context, this question is a follow-up of this one: Bash remote autocompletion : change the 'starting' directory Anyway, I'm writing my custom autocompletion bash script: I want the ...
5
votes
2answers
846 views

How to enable tab completion of wildcards in bash?

How can I enable tab completion in bash for a statement such as vim db/migrate/*crea? Essentially I am looking for tab completion to match the regular expression and present the options. How would ...
3
votes
1answer
314 views

Bash remote autocompletion : change the 'starting' directory

I'm regularly downloading files from a remote server, always from the same directory. So I wrote a custom function that I put in my bashrc: download_from_myserver () { for file in "$@" do ...
3
votes
2answers
1k views

Bash and Tab Auto-complete

I recently put Fedora Core 15 on my system, and I've had a behaviour change that I can't figure out. Using Tab-Complete in the BASH shell works fine except when I use the $HOME variable. If I type cd ...
12
votes
2answers
3k views

Make zsh completion show the first guess on the same line (like fish's)

In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway ...
8
votes
1answer
124 views

Disable Bash autocompletion for a specific command only

Is it possible to disable Bash's autocompletion for a specific command only? Use case: For obvious reasons, I would like to disable autocompletion for the rm command when I'm root. It would also be a ...
5
votes
1answer
327 views

zsh - fully expand binary path on <tab>

In my current zsh behaviour, hitting tab after typing "sudo" just adds a space. $ sudo ... What I really want is for the tab to fully expand to the path of the binary it is about to execute when I ...
4
votes
2answers
2k views

Disable bash tab completion

Is it possible to disable bash's autocomplete on pressing tab? The reason I want to do this is that I often paste code from an editor where I use the tab character instead of a number of spaces for ...
3
votes
1answer
199 views

Add autocompletion for custom script

I am currently working on a shell script I called makeyourself.sh (linked to /usr/bin/mys) which automatically installs a debian package from source (via apt-get source -b $1). So I decided to add an ...
3
votes
3answers
156 views

Autocomplete newest file

I have a process which creates text files whose filenames are based on the timestamp of their moment of creation: $ ls 1378971222.txt 1378971254.txt 1378971482.txt 1378971488.txt 1378972089.txt ...
2
votes
1answer
195 views

Stop tab completion suggesting 'messagebus'

I've got a directory called build, which I cd into quite a bit. If there isn't any directory bu* in the current directory, zsh tab completion: cd buTAB suggests messagebus/, which isn't in .. If I ...
1
vote
1answer
716 views

Autocompletion for Makefile rules in tcsh

I'm using tcsh in a SUSE 11 box and I realized that when typing makeTab it allows me to auto-complete the rules available within the Makefile, not the files that are inside the current directory. ...
1
vote
2answers
816 views

autocomplete filenames using compgen

As part of a larger autocomplete function I'm writing, I want to use compgen to generate a list of files. I read the bash manual entries for compgen and complete, and from there I assumed that the ...