1
vote
1answer
31 views

Hide make targets from shell when users autocomplete in bash

Is there a way to flag some targets in a Makefile so that they don't appear at all in the shell when the user types make and then presses Tab ? I am having a Makefile with too many recipes and I don't ...
1
vote
3answers
110 views

How to do command-line completion with files and folders

As a new Linux user, one of the things that's kept me away from the Command Line (CL) is that, for tasks involving files and folders (i.e. everything!), the amount of typing involved makes using the ...
12
votes
3answers
853 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 ...
5
votes
2answers
64 views

exclude particular file from bash_completion

I have a simple bash_completion code. The only thing it does, is when I type grcat and then Tab, it offers to complete filenames from /etc/grcat. _grcat() { local word COMPREPLY=() if [ 1 ...
11
votes
1answer
392 views

How do command-line tools have their own autocomplete list?

How does Bash in Ubuntu know a tool's specific list of actions? For example if I type apt-get and tab twice I only see remove, update, upgrade ...etc, but not the actions for another command or the ...
1
vote
1answer
53 views

Bash Autocompletion (rather than tab completion)

How can I make bash show completion suggestions without having to press [tab]. I'd like the suggestions to update on each character I add and maybe to have the ability to quickly pick an option. I'd ...
1
vote
1answer
33 views

Modify $READLINE_LINE and $READLINE_POINT values inside bash script

I already asked this question on stackoveflow, but received no answer and very few views. I thought I would post here as there should be more bash users and someone might have already stumbled upon ...
6
votes
1answer
96 views

How to customize Bash command completion?

In bash, it's easy enough to set up customized completion of command arguments using the complete built-in. For example, if, for a hypothetical command with a synopsis of foo --a | --b | --c, you ...
5
votes
2answers
47 views

Is it possible for bash completion to cycle through the alternatives?

When using bash completion and an a number of characters have been entered, tabbing ceases to work then the prefix you have typed is matched by more than one of the possibilities. Is there a way to ...
9
votes
3answers
125 views

Bash autocomplete with vim command

In bash, autocompletion of paths has recently stopped working when issuing vim commands where the path is deeper than two directories (it continues to work as expected with other commands, such as ls ...
3
votes
0answers
141 views

bash does not autocomplete my command when using sudo?

I'm using SaltStack. I would like to auto-complete the minion name when calling salt command. The following line has been added into ~/.bashrc: complete -o default -o nospace -W "$(sudo ls -1 ...
2
votes
0answers
56 views

Bash tabcomplete file names for environmental variable values

After I upgraded my Ubuntu from 12.04 to 14.04, bash would no longer let me tabcomplete file names when setting the value of an environmental variable, e.g. FILE=/home/_ _ is where I would press ...
1
vote
1answer
92 views

Autocomplete server names for SSH and SCP

I have a few servers configured in ~/.ssh/config, such as alpha and beta. How might I configure Bash such that the commands ssh al<tab> and scp file.tgz al<tab> autocomplete the names of ...
4
votes
1answer
98 views

Is there a way to customize “Programmable Completion” in the current session?

If I start typing a command or filename, I can use the tab key to auto-complete my string. That is well known... Is there a way to change the behavior of the auto complete for the current bash ...
3
votes
1answer
40 views

Redistributable completion for my bash scripts

Is there a simple way to embed the completion features inside a script, for bash ? I have a script that I want to redistribute, but I can't ask the people to add something inside their ...
4
votes
2answers
73 views

Is there a workaround for Debian file-completion trashing $_?

I have years of experience on Slackware linux, and have never seen this problem there. Lately I have been administering Debian servers, and this has become an annoyance. I frequently use "$_" in a ...
2
votes
1answer
97 views

Autojump auto-complete feature does not work

On my configuration, autojump autocomplete feature does not seem to work. To be clear, autojump works properly, only the autocomplete feature fails to work. When I press the <TAB> key, the ...
3
votes
1answer
114 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 ...
22
votes
1answer
554 views

How do I redirect command completion output?

On the command line, I can redirect or pipe output of a command to a file or another command using the > or | operator after the command. I have come across a less standard situation that I would ...
4
votes
1answer
40 views

Tab-completion within for loops not working

I'm either going crazy or about to ask a stupidly basic question. I appreciate your patience either way. Tab completion for executable command is not working within interactive for loops in bash. I ...
3
votes
2answers
117 views

Bash autocomplete variables for other commands than cd

I have env variable $SCRIPT. Normaly I can use autocomplete vim $SC<tab> and completion works as expected. On some systems it does not work. I have bash completion loaded, but completion in ...
11
votes
1answer
424 views

Bash completion for comma-separated values

I would like to create completion rule for comma-separated parameters list. E.g. I have command which receives list of server names: myscript -s name1,name2,name3 At this moment I've managed to ...
3
votes
1answer
152 views

how to edit and color bash's tab completion list

Following is what i would like to have. When the tab completion is ambiguous, and bash prints the list of possibilities. I would like it to colour the next character I should press inside every word ...
1
vote
1answer
86 views

Add arguments when completing a command name

I am looking for a way to expand some predefined strings in the terminal when tab (or another key combination) is pressed. This is different from tab completion. My terminal already expands ~ to my ...
4
votes
2answers
147 views

Force Bash normal tab completion if intelligent completion fails

Since tab completion became a standard feature in shells I have been a very happy user of it. I even like Bash's intelligent completion (where it only searches for PDF files, if I type evince ...
3
votes
1answer
77 views

Bash tab completion stop searching

When I am typing into bash and I press the "tab" key to auto complete, sometimes it takes a significant time. E.g., file IO to read directories takes >5 seconds, and thus I am hung waiting for IO to ...
4
votes
2answers
221 views

Completion of words on the screen as in VIM (Bash or Tmux)

How can I configure Bash, Zsh or Tmux to complete the last matching identifier on the screen? Consider this common scenario: $ git fetch remote: Counting objects: 16, done. remote: Compressing ...
4
votes
2answers
416 views

Command completion does not complete the files in the current directory

Something is wrong with my tab completion. Let's say I do this: cd test // works fine, go into test directory ls // works fine, displays all of the files Let's assume I have the following files: ...
3
votes
1answer
102 views

compgen warning: -C option not working as I expected

What is the correct way to use the compgen -C option? I'm trying to learn about Bash programmable completion, and in particular the compgen builtin function. I'm experimenting with the different ...
1
vote
1answer
53 views

How can I add autocomplete for “gem which” with rbenv?

I am using rbenv on Mac OS X. I have autocomplete functionality already for the gem command: $ gem build environment lock query stale cert fetch ...
2
votes
2answers
71 views

How to add all binaries to bash tab completion for some command?

I've installed program trickle that allow to throttle the net for specified command like: trickle -u10 -d10 <COMMAND> How to add bash completion for all binaries to trickle command?
3
votes
1answer
239 views

Bash autocompletion for an environment variable holding a directory name

I'm using, among other things, bash 4.2.37 on Linux Mint 14. When I autocomplete the name of an environment variable by typing Tab, it expands to the name of the variable followed by a space. If the ...
2
votes
3answers
229 views

How to add pattern to bash completion (for unzip)?

When I type unzip <tab> I get a list of all files ending in .zip, which is the standard behavior of tab completion for the unzip command. However, I also want bash completion for unzip ...
3
votes
1answer
89 views

code review: automatic completion for bash aliases

I was reading How do I get bash completion for command aliases? and I thought, that the answer Shawn J. Goff needed a little something: less user setup so I wrote a little script that is intended to ...
4
votes
1answer
104 views

bash_completion for initscripts

I have writen my own initscript /etc/init.d/myscript. I can start and stop my script with the service command service myscript start service myscript stop When I type service <TAB>, ...
3
votes
1answer
59 views

How to cd open / autocomplete a folder that ends in a specific phrase

I have a folder with subfolders named like this: 1122334 important things 1122335 less important things 1122336 notes 1122337 pictures of kittens etc The numbers at the beginning are date codes. ...
1
vote
1answer
124 views

How to globally enable all of Gentoo's bash completions at once?

eselect bashcomp enable unfortunately seems to lack a --all option, and I certainly don't want to manually activate each of the 194 entries. Can this be automated somehow, and set up such that ...
3
votes
1answer
71 views

How can I get Bash to display the auto-completion definitions for a given command?

I use module command to load and unload stuff to my environment, some of the machines I use have proper auto-completion others do not. I'm wondering if I it possible to know where the completion ...
8
votes
1answer
106 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 ...
1
vote
1answer
130 views

prevent bash completion from altering underscore variable $_

When using tab completion in bash, the $_ variable is altered: $ mkdir test $ cd <TAB><TAB> $_ bash: cd: -d: invalid option cd: usage: cd [-L|[-P [-e]]] [dir] (The ...
1
vote
0answers
104 views

How can I reset the bash filename completion for “more”?

I've done something that has changed the way TAB auto-complete works, but only for the more command. Every other command lists the possible completions, but more now lists ALL of the possibilities ...
8
votes
3answers
387 views

Select unicode filename in Bash

Ok; suppose I'm in Bash and I have several files in a folder. Several of them are named file☠☡☢☣.txt, where ☠☡☢☣ starts with crazy untypable unicode characters. How would I refer to one of them? ...
6
votes
3answers
172 views

How to order files by date in tab completion list

$ 7z l ~/Downloads/Tab How to make the resulting list to be sorted by date, not by name? I currently use special script to list N most recent files in a given directory (and copy the filename ...
3
votes
3answers
143 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 ...
3
votes
2answers
302 views

Enable Bash-Completion to expand Superuser executables to full path

I'm running OpenSUSE 12.3 (and have seen the behavior since 11), and have found that I can't call Superuser programs (e.g. shutdown, reboot) without using the full path. For me, many of these ...
2
votes
1answer
114 views

Autocomplete doesn't work for file parameters to jarsigner

I'm using Lubuntu 12.10. Assume I've got a file called test.apk in my current folder. 1.) In LXTerminal/bash if I type, adb install t<TAB> the terminal autocompletes it correctly to ...
1
vote
1answer
162 views

How to make a custom bash tab completion? [duplicate]

I want to make tab completion to complete on specific programs in path although there maybe other possible completion in path. For example, if I type mpl and tab, it should complete to mplayer ...
0
votes
0answers
157 views

Unable to autocomplete ONLY when typing a make command

I'm running Ubuntu Linux 10.04. And I have the following in my .bashrc file: if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi I'm having a problem ...
5
votes
2answers
691 views

How can I fix this SSH hostname tab completion script?

I found the following script (for bash) that enables me to get tab completion for any hostname I've connected to (from ~/.ssh/known_hosts): complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ...
5
votes
3answers
387 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 ...