
默认情况下,在安装Gentoo Linux或其他发行版之后, Shell中的自动完成功能(在本例中,我们将讨论BASH ,但是,我们将为其他Shell提供提示)未安装。 通常您会在途中找到他:
- / etc / bash_completion
- bash_completion.d / *
- /etc/bash_completion.d/gentoo-style-init
也就是说,如果您使用git , man ,…,您会注意到,下一个命令参数将不会通过[TAB]键自动完成。
如果您只想在当前使用它,则可以使用带有参数’c’和’f’的complete命令。 使用complete命令自动完成参数的示例:
完整的-cf人
运行此命令后,您会注意到,如果使用man命令,现在将显示一个参数( man [command] )。 尽管使用此解决方案出现了一些观察结果:
- Panduan Praktis BlankOn Untuk Pemula
- 大批量请求下的Nginx失败:事后模式
- 适用于OffiDocs的LibreOffice Online 6.1.1.2
- HBO现在在Linux上,现在已死
- 在生产中调试Docker Heisenbug
它可以自动完成一些甚至没有手册的命令。
在其他命令中,可能存在过多的可能性,这些可能性并不总是链接到所需的命令。
关闭终端时,您会注意到配置将丢失(但是在这种情况下,您可以将其添加到.bashrc中,例如
echo "complete -cf [comando]" >> ~/.bashrc
)。
如果您在Shell中注意到一些“混乱”,则可以使用“ r”选项通过以下命令“删除”此配置:
完整的-r人
但是,最正确的解决方案是为Shell安装bash-completion应用程序 。
要安装它,请使用:
出现-询问app-shells / bash-completion
安装后,请检查git,man,…命令是否已使用[TAB]键自动完成参数!
如果要查看文件,请运行命令
猫/etc/bash_completion.d/gentoo-style-init
对于其他外壳程序和应用程序,有以下选项:
app-shells / zsh完成
app-shells / tmux-bash-completion
app-shells / mpv-bash-completion
app-shells / gentoo-zsh完成
有关更多信息,请运行“ Portage”搜索命令:
出现-搜索完成
出现--searchdesc bash-completion
https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html
http://tldp.org/LDP/abs/html/tabexpansion.html
https://wiki.gentoo.org/wiki/Bash
https://wiki.gentoo.org/wiki/Bash/Installing_completion_files
https://wiki.archlinux.org/index.php/Bash
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion
https://www.vivaolinux.com.br/dica/Habilitando-autocomplete-para-o-sudo-e-man
入门到高级Shell脚本课程:https://goo.gl/ftMqnQ
文本编辑器课程Vim:
https://goo.gl/BPGbLU
访问我们的网站/博客:
http://terminalroot.com.br/
我们的GitHub:
https://github.com/terminalrootsh
订阅此频道:
https://www.youtube.com/TerminalRootTV
在G +上圈出我们:
https://google.com/+TerminalRootTV
在Twitter上关注:
https://twitter.com/TerminalRootTV
享受我们的Facebook页面:
http://facebook.com/TerminalRoot
在Reddit上关注我们:
https://www.reddit.com/user/terminalroot/
请参阅我在Medium中的帖子:
https://medium.com/marcos-oliveira/
加入我的Linkedin:
https://www.linkedin.com/in/marcos-oliveira-952389138/
我们的Tumblr:
https://terminalroot.tumblr.com/
没有SL配置文件:
http://softwarelivre.org/profile/terminalroot
Pinterest:
https://br.pinterest.com/terminalroot/