我正在运行的计算实例是一个Debian Buster。通常存在一个/etc/bash_completion文件。但是对于GCE来说,它不见了。他们甚至在默认的~/.bashrc中添加了一个部分来引用bash完成文件,而这些文件都不存在。
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi发布于 2020-10-09 20:56:47
您是对的,它不是默认安装的,我在自己的项目中尝试过创建一个新的Debian实例,而且/etc/bash_completion不存在。
/etc$ ls -l bash_completion
ls: cannot access 'bash_completion': No such file or directory只有在安装bash完成后,/etc/bash_completion文件才会出现.
sudo apt-get install bash-completionReading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
bash-completion
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 208 kB of archives.
After this operation, 1397 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 bash-completion all 1:2.8-6 [208 kB]
Fetched 208 kB in 0s (960 kB/s)
Selecting previously unselected package bash-completion.
(Reading database ... 37801 files and directories currently installed.)
Preparing to unpack .../bash-completion_1%3a2.8-6_all.deb ...
Unpacking bash-completion (1:2.8-6) ...
Setting up bash-completion (1:2.8-6) ...
Processing triggers for man-db (2.8.5-2) ...安装后:
/etc$ ls -l bash_completion
-rw-r--r-- 1 root root 45 Feb 11 2019 bash_completionhttps://serverfault.com/questions/1037110
复制相似问题