RedHat/Fedora/Centos 下bash 自动补全命令
2016-08-25 10:16
676 查看
本文转自:运维生存时间:http://www.ttlsa.com/linux/rhel- ... matically-function/
linuser :http://www.linuser.com/thread-1085-1-1.html
Bash命令自动完成功能只不过是收集各种黑客指定参数是如何通过Readline使用内置完成来完成的。该功能在其他linux分支是启用的,如ubuntu、debian等等。然而,基于RHCE分支发布的linux版本却没有安装和启用,如CentOS。
如果你使用过ubuntu系统,bash命令自动补齐会觉得非常方便高效。再使用RHCE或CentOS的话,你肯定会吐槽一番的,“这bash是什么鬼东西,不能自动补齐。”
那么RHEL / CentOS 怎么启用bash命令自动补齐功能呢?请看下面
1、首先需要安装bash-completion 包:
2、安装完成后,需要用source 命令或者是注销当前登陆用户重新登陆系统使其立即生效,如下:
3、此时你就可以使用bash 的自动补全了,如下:
4、实例,加入我现在不知道apache 在centos 上面的包名,而我需要使用apache 服务,则可以这样:
linuser :http://www.linuser.com/thread-1085-1-1.html
Bash命令自动完成功能只不过是收集各种黑客指定参数是如何通过Readline使用内置完成来完成的。该功能在其他linux分支是启用的,如ubuntu、debian等等。然而,基于RHCE分支发布的linux版本却没有安装和启用,如CentOS。
如果你使用过ubuntu系统,bash命令自动补齐会觉得非常方便高效。再使用RHCE或CentOS的话,你肯定会吐槽一番的,“这bash是什么鬼东西,不能自动补齐。”
那么RHEL / CentOS 怎么启用bash命令自动补齐功能呢?请看下面
1、首先需要安装bash-completion 包:
[root@server src]# yum install -y bash-completion
2、安装完成后,需要用source 命令或者是注销当前登陆用户重新登陆系统使其立即生效,如下:
[root@server src]# source /etc/bash_completion
3、此时你就可以使用bash 的自动补全了,如下:
[root@server src]# yum [Tab 键] --assumeyes --config distro-sync groupinfo history - --cacheonly --debuglevel downgrade groupinstall info - check deplist --enableplugin grouplist install - check-update --disableexcludes --enablerepo groupremove --installroot p clean --disableplugin --errorlevel help list - --color --disablerepo --exclude --help makecache - [root@server src]# yum in[Tab 键] info install
4、实例,加入我现在不知道apache 在centos 上面的包名,而我需要使用apache 服务,则可以这样:
[root@server src]# yum install -y htt[Tab 键] httpd-devel.i686 httpd-manual.noarch httping.x86_64 http-parser.i686 httpd-devel.x86_64 httpd-tools.x86_64 http-parser-devel.i686 http-parser.x86_64 httpd-itk.x86_64 httpd.x86_64 http-parser-devel.x86_64 httpry.x86_64
相关文章推荐
- shell脚本中字符串比较
- AX2012 Management Shell如何使用
- shell简单命令
- shell脚本删除指定目录下超过指定时间的文件
- linux shell 获取当前正在执行脚本的绝对路径
- Shell--LANMP自动编译安装并卸载!
- 【最短路】BAPC2014 B Button Bashing (Codeforces GYM 100526)
- shell 实现多种图形
- shell自动抓取年、月,自动识别列数,按月批量处理mysql输出的多个txt文件
- 【最短路】BAPC2014 B Button Bashing (Codeforces GYM 100526)
- awk相关操作(简单举例查询IP地址)
- Linux Shell数据重定向
- bash scp command not found的解决方法
- Shell
- linux shell学习笔记
- 数组,字符串处理,mktemp命令,install命令,bash的环境配置文件,程序包编译
- bash的字符处理工具及bash特性
- Bashe Shell之数组及bash配置文件解析
- 使用shell 脚本做简单的压力测试
- shell脚本中一些特殊符号