Skip to main content

Questions tagged [auto-completion]

Anything related to automatic completion of path/file/folder names or commands such as the ones provided by bash-completion package

Filter by
Sorted by
Tagged with
247 votes
5 answers
165k views

Can I make Tab auto-completion case-insensitive in Bash?

Ubuntu's Terminal uses case-sensitive auto-completion, as would be expected for Linux. But I think sometimes it would be more convenient to use a case-insensitive one instead, to save you having to be ...
mwfearnley's user avatar
  • 3,387
192 votes
8 answers
174k views

How to create script with auto-complete?

When I use program like svn and I type in Gnome Terminal: svn upd and hit Tab it's autocompleted to: svn update Is it possible to do something like that in my custom bash script?
UAdapter's user avatar
  • 17.7k
103 votes
4 answers
287k views

Terminal autocomplete doesn't work properly

If I start typing a command like apt-g after hitting tab, the shell completes the command to apt-get, but for the second part of the command like install, if I enter some characters like insta, ...
Ravexina's user avatar
  • 55.9k
76 votes
4 answers
113k views

`apt-get` autocompletion of package name is broken

At some moment, the apt-get install autocomplete was broken. It was very useful to me to see the names of packages available for installation when pressing Tab. For example, if I would press the Tab ...
Вячеслав Логинов's user avatar
60 votes
5 answers
115k views

Tab completion doesn't work for commands

I am trying to use tab completion for commands in Ubuntu 11.04 Beta 1, running all the latest updates, but it doesn't seem to work. (Though package bash-completion is installed) Tab completion works ...
Screatch's user avatar
  • 619
44 votes
4 answers
227k views

How to make terminal autocomplete when there are several files/directory?

If I have several directories, like: afoo abar sometimes my terminal will refuse autocomplete when I press tab (e.g. "cd a" then tab), and print the list of directories instead. Sometimes it even ...
TifatulS's user avatar
  • 1,305
41 votes
7 answers
58k views

auto-completion does not work for "sudo apt-get install" [duplicate]

Okay a college of mine just showed me that you could do sudo apt-get install <type first letters of package> <TAB> That it auto-completes the name of the package. Just for an example... ...
WG-'s user avatar
  • 1,830
34 votes
8 answers
14k views

How to alias 'git' to 'g' so that bash-completion rules are preserved?

If I do this: alias g='git' I lose all completion rules (i.e. branches and remotes are no longer automatically completed when I hit TAB after typing, for example g push o).
Paweł Gościcki's user avatar
31 votes
5 answers
34k views

Autocompletion doesn't work while logged as root

I have just came across something that is really bothering me. Autocompletion on ubuntu works like a charm but when I login as root, e.g. su I get tab autocompletion only sometimes. Why does it work ...
Patryk's user avatar
  • 9,206
22 votes
2 answers
49k views

Terminal, how to quit --More-- list

I use autocomplete a lot in the terminal, like for example for cp command. But sometimes, when I am putting in the directory for the cp command and I press Tab, the list of files is so long that ...
Mr. Fegur's user avatar
  • 325
21 votes
1 answer
14k views

Bash Tab Completion: '-bash: unexpected EOF while looking for matching `)' -bash: syntax error: unexpected end of file

I'm trying to go into an irb session with specific environment variables from a file with this command: $ env $(cat env.sh) irb But when I try press Tab after I type env. to complete it, I get this ...
eldosoa's user avatar
  • 745
20 votes
6 answers
18k views

Why does terminal auto complete sometimes not suggest anything for the `services` command?

Sometimes, when I type a command on the terminal, the terminal's autocomplete does not work, even if my command is not wrong. For example, take look to this: sudo service vsftpd status sudo and ...
Mohammad Reza Rezwani's user avatar
20 votes
1 answer
25k views

Bash auto_completion with Xubuntu and xrdp from windows

I'm using Xubuntu and connecting over RemoteDesktop with Windows 7. Everything works fine, but the auto_completion in my bash doesn't work. I checked the .bashrc file in my home directory and also ...
nik the lion's user avatar
20 votes
2 answers
11k views

Can I enable bash-completion for the new apt command?

The new apt command, present in Ubuntu since 14.04, seems to be a really useful intersection of functionality between apt-get and apt-cache but the current version of bash-completion doesn't know ...
Oli's user avatar
  • 295k
18 votes
3 answers
7k views

Does pip have autocomplete?

Pip has a long list of commands. Is there any way to use auto-complete by Tab in console (Bash)?
Yurij's user avatar
  • 565
18 votes
4 answers
22k views

Is it possible to get tab completion with sftp?

Sometimes I need to quickly copy a file from my remote server to my local machine. Here's my current workflow: I SSH into my remote server, find the file and copy its full path. I open new terminal ...
Olivier Lalonde's user avatar
17 votes
1 answer
6k views

How to make bash stop tab autocompleting hidden directories

Most of the time, I don't need autocompletes for my hidden directories. In fact, that's the point of them being hidden! However, annoyingly, bash takes these directories into account when ...
Kristopher Micinski's user avatar
16 votes
2 answers
16k views

Bash Completion Doesn't Work In Root User

I'm on 12.04 and I'm trying to find a way to enable Bash completion in root user. Any ideas on how to do that?
T0M XeOn LuCiFeR's user avatar
16 votes
1 answer
7k views

enabling auto completion for apt-get install in docker (ubuntu 14.04)

I am running an ubuntu container in docker. I tried everything I found online, including: auto-completion does not work for "sudo apt-get install" but pressing "tab" still has no effect
Vince's user avatar
  • 195
14 votes
2 answers
28k views

Terminal command autocomplete

I'm currently trying to switch from OpenSUSE to Ubuntu as my main OS. While most of opensuse features is there in ubuntu, there is one feature that doesn't. In Opensuse, I can always use Ctrl+Up to ...
Edhoari's user avatar
  • 141
13 votes
3 answers
17k views

sudo command doesn't autocomplete anymore on files

Ubuntu 16.04.1 LTS I don't know what I did, everything was working fine, but since today my bash doesn't autocomplete anymore when I use sudo. I can use the autocompletion as normal user, I can use ...
effemmeffe's user avatar
13 votes
1 answer
5k views

Select a particular result from completion suggestions

Let's say I have 3 files in a particular directory: abc.txt, aww.txt, ant.txt If I do: cat a (and press tab to see options) terminal will display the 3 file names: abc.txt, aww.txt, ant.txt Is there ...
samsamara's user avatar
  • 397
12 votes
1 answer
470 views

What does _expand do?

I was working with the shell, and by mistake I autocompleted with tab after writing _e, which resulted in _expand. What does this command do? I couldn't find an explanation online, the only ...
0x5C91's user avatar
  • 221
11 votes
3 answers
5k views

How do I enable zsh package suggestions as in Ubuntu bash?

I'm slowly transitioning to zsh from bash and am loving almost every part of it, but there are two things I'm really missing. One of them is snap completions, see here: Enable snap TAB-completion for ...
El Senor's user avatar
  • 352
10 votes
4 answers
21k views

Bash Tab Auto-complete not working for apt

apt-get install and apt-cache policy do not complete package names. I have double checked /etc/bash.bashrc, no irregularities. Googled for answers but none suffice. Any help/advice?
beanaroo's user avatar
  • 1,175
10 votes
1 answer
3k views

How to make tab completion append slash for directory symlinks?

My ~/Documents directory is a symlink: nathan@nathan-desktop:~$ stat Documents File: Documents -> /mnt/nathan/extended/Documents If I want to cd into the directory, I can type: c d space D o ...
Nathan Osman's user avatar
  • 32.3k
10 votes
2 answers
18k views

Why doesn't auto complete work in my shell?

I am not so into Linux and I have the following doubts: a client provided me an Ubuntu 18.04.3 LTS virtual machine which I access via SSH. (I am using MobaxTerm as SSH client but it should not be the ...
AndreaNobili's user avatar
  • 4,599
10 votes
1 answer
1k views

No tab completion with asterisk *

I am not able to tab complete from the command line in gnome-terminal when I have an asterisk in the command line. Default shell is bash, using gnome-terminal. For example, This works to copy a ...
sef's user avatar
  • 191
9 votes
3 answers
25k views

What tool do I need to install to make my terminal show the autocompletion of the command that I'm writing?

I use Ubuntu on a daily basis, recently I've seen that the terminal on Kali Linux behaves differently from the terminal on Ubuntu... I can see the end of the command that I'm typing based on the ...
raylight's user avatar
  • 493
9 votes
1 answer
11k views

How to make my ubuntu auto-shutdown after successful update?

Using a EDGE for update is really not cool but i have to. So my update always runs in night when i go to sleep. Is there any way to set ubuntu to auto-shutdown after completion of update. Note: I ...
22lk94k943 only's user avatar
9 votes
2 answers
6k views

Any way to list similar commands?

When you write the command name wrong, bash often does this: septi@norbert:~$ good No command 'good' found, did you mean: Command 'gold' from package 'binutils' (main) Command 'gmod' from package '...
Septagram's user avatar
  • 1,067
9 votes
0 answers
77 views

Bash Tab-autocompletion inside command substitution "$( ... )" [duplicate]

I am using Bash's Tab autocompletion quite often, but when I'm inside a Bash command substitution structure like in the example below, it breaks and only returns an error. Let's assume I want to find ...
Byte Commander's user avatar
  • 108k
8 votes
3 answers
37k views

Terminal autocompletion 'tab' not working as intended?

I know this has been discussed on other posts but my problem does not seem to be fully resolved and I do not have permission to add a comment to those posts yet :( listed on help.ubuntu.com > ...
user1575949's user avatar
8 votes
1 answer
558 views

How do I control when bash auto-completion shows a paged list of completions?

In my previous linux installations the bash auto-completion has always worked without problems. If I wanted to do anything to files, giving a prefix of the filename and pressing tabulator listed all ...
whamalai's user avatar
  • 171
8 votes
1 answer
7k views

How to autocomplete formulas in LibreOffice Calc

I recently moved from MS Excel 2007 to LibreOffice Calc (now using Ubuntu 11.10) and there are some things that I still cannot do in LibreOffice Calc. One of these things is formula autocompletion. In ...
Rafael's user avatar
  • 675
7 votes
3 answers
4k views

How to make alias to systemctl with autocomplete

I tried alias sct='systemctl' complete -F _systemctl sct But the function _systemctl is not found until I run the original command systemctl in the session. This function loads dynamically or somehow ...
tehkonst's user avatar
  • 343
7 votes
5 answers
3k views

Shell tab-completion for service command broken as root

On most of our servers, tab completion of service names after typing in the service command no longer works, as root. It works just fine as non-root. This is on Ubuntu 12.04. I'm not sure how to ...
Zachary Alex Stern's user avatar
7 votes
0 answers
5k views

System freezes during Bash auto-completion with Tab or Ctrl+R

It started about a week ago, don't know why. Now, when I type something like cd somedir and click Tab, my system completely freezes for about 10 seconds. I can move the cursor but can't switch between ...
Spaceman's user avatar
  • 171
6 votes
2 answers
2k views

bash autocomplete behaving strangely after update

Since bash was updated very recently, when I try to autocomplete by tabbing during a cd I get the following... tony@tony-HP:~$ cd Mucword=1 words[0]=${!ref}${COMP_WORDS[i]} words[1]=${!ref}${...
Tony Martin's user avatar
6 votes
1 answer
4k views

ssh known_hosts file not using hostnames anymore

I'm running into this weird issue when I ssh into a new machine but my known_hosts file gets updated with a hash of sorts but not the hostname. This ends up with me not being able to autocomplete when ...
Koen van der Rijt's user avatar
6 votes
2 answers
3k views

How should I install my own bash completion script?

I've written some software that includes its own Bash completion script. This script works fine when I source it manually, but I'm trying to figure out how best to install on Ubuntu 18.04. There are ...
user161768's user avatar
6 votes
3 answers
711 views

Bash cannot expand backticks interactively

On RHEL5.2 (bash 2.3.25) I can cd `pwd`/[TAB] and pwd is substituted into my current working directory, using the output of pwd(1). How can I achieve the same functionality in Ubuntu 9.10 (bash 4.0....
The_Viper's user avatar
6 votes
2 answers
3k views

Autocomplete on .bash_aliases commands?

I have a whole bunch of aliased commands in .bash_aliases The most generic examples are alias apt-update="sudo apt-get update" alias apt-upgrade="sudo apt-get dist-upgrade" but then I also have ...
Hailwood's user avatar
  • 4,977
6 votes
1 answer
2k views

How do I get tab completion to work with 'rake'?

When I try to use tab completion with rake, only files are suggested: $ rails test-app | grep -v create; cd test-app $ rake <TAB><TAB> app/ db/ lib/ public/ README ...
ændrük's user avatar
  • 77.2k
6 votes
1 answer
6k views

Disable autocompletion in Atom

So I just recently got into coding (Python) and I am using Ubuntu 16.04 and the Atom text editor. A very annoying feature is the auto-completion. For example, I type in x (a variable I set previously)...
G. Sarkap's user avatar
6 votes
2 answers
290 views

Tab-completion of shell patterns

On my Debian servers I'm used to hitting Tab to "preview" the expansion of shell patterns: $ cp *some*<Tab> something somewhat have-some-cake $ cp *some*_ When the pattern expands to one ...
Tobia's user avatar
  • 575
6 votes
1 answer
991 views

How can you mirror an autocomplete function in your own aliases (in 14.04)

I have a bunch of aliases that I've used on my 12.04 machine. example: alias pssh="tsocks ssh" alias pscp="tsocks scp" alias prdp="tsocks xfreerdp ..........SOMETHING ...." These aliases are ...
WBang's user avatar
  • 63
6 votes
1 answer
2k views

How to configure case insensitive completion for git in bash?

I use Ubuntu 16.04 for web development. Its default shell is bash. I use git for source versioning. I would like to have git branch names with case insensitive completion. At the moment, completion ...
Marecky's user avatar
  • 119
5 votes
6 answers
22k views

Ubuntu command-line suggestion

I've been using Ubuntu 20.04 and trying to get used to it. but repeating same command in terminal is quit boring. i just want some suggestion to get rid of it and how can i get visible command-line ...
Mojaer Ahmed's user avatar
5 votes
2 answers
1k views

Why doesn't Bash completion for 'cc' and 'c++' work?

While trying to compile using a C/C++ file using cc/c++ commands, I find that it is no longer possible for me to use Tab key for bash-completion. I could do the same before 12.10. Also, when ...
shivshnkr's user avatar
  • 5,073

1
2 3 4 5