用途说明
在使用bash命令行时,在提示符下,输入某个命令的前面几个字符,然后按TAB键,就会列出以这几个字符开头的命令供我们选择。不光如此,还可以进行参数补全,但只限于文件参数,当输入到参数部分时,按TAB键,就会列出以这个参数开头的文件路径供我们选择。Bash提供了一个complete内建命令,它的用途是规定参数怎么自动补全(Specify how arguments to each name should be completed.)。它怎么使用在网上的资料都没怎么看见,man手册页不太想看,但是这个世界好人真的挺多,网站http://www.caliban.org/bash/ 提供了一个称之为bash-completion的软件包,通过一个复杂的脚本bash_completion实现可编程的补全程序,减少系统管理员日常维护工作,减少差错,提高工作效率。
常用参数
不用管参数了,只管在输入参数时按TAB键补全了。
使用示例
示例一 安装bash-completion的过程
[root@rhel55 ~]# type -a complete
complete is a shell builtin <== complete是一个Bash内建命令
[root@rhel55 ~]#
[root@rhel55 ~]# cd setup/
下面用wget从 http://www.caliban.org/bash/ 下载源代码的rpm包。
[root@rhel55 setup]# wget http://www.caliban.org/files/redhat/SRPMS/bash-completion-20060301-1.src.rpm
--2010-10-28 13:32:20-- http://www.caliban.org/files/redhat/SRPMS/bash-completion-20060301-1.src.rpm
正在解析主机 www.caliban.org... 83.98.221.239
Connecting to www.caliban.org|83.98.221.239|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:170596 (167K) [application/x-rpm]
Saving to: `bash-completion-20060301-1.src.rpm'
100%[==========================================================================================>] 170,596 91.0K/s in 1.8s
2010-10-28 13:32:23 (91.0 KB/s) - `bash-completion-20060301-1.src.rpm' saved [170596/170596]
[root@rhel55 setup]# ls -l bash-completion-20060301-1.src.rpm
-rw-r--r-- 1 root root 170596 2006-03-02 bash-completion-20060301-1.src.rpm
[root@rhel55 setup]# rpmbuild --rebuild bash-completion-20060301-1.src.rpm
Installing bash-completion-20060301-1.src.rpm
warning: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID bfbaf0e8
warning: user ianmacd does not exist - using root
warning: group ianmacd does not exist - using root
warning: user ianmacd does not exist - using root
warning: group www does not exist - using root
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.75172
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf bash_completion
+ /usr/bin/bzip2 -dc /usr/src/redhat/SOURCES/bash-completion-20060301.tar.bz2
+ tar -xvvf -
drwxrwxr-x ianmacd/ianmacd 0 2006-03-02 00:38:44 bash_completion/
drwxrwxr-x ianmacd/ianmacd 0 2006-03-01 18:45:13 bash_completion/contrib/
-rw-r--r-- ianmacd/ianmacd 748 2005-01-03 10:44:22 bash_completion/contrib/sitecopy
-rw-r--r-- ianmacd/ianmacd 261 2003-12-31 16:22:37 bash_completion/contrib/isql
-rw-r--r-- ianmacd/ianmacd 388 2002-06-13 06:03:23 bash_completion/contrib/bitkeeper
-rw-r--r-- ianmacd/ianmacd 442 2004-03-31 06:39:11 bash_completion/contrib/cksfv
-rw-r--r-- ianmacd/ianmacd 3621 2003-12-31 16:22:37 bash_completion/contrib/dsniff
-rw-r--r-- ianmacd/ianmacd 1254 2003-12-31 16:22:37 bash_completion/contrib/freeciv
-rw-r--r-- ianmacd/ianmacd 659 2003-12-31 16:22:37 bash_completion/contrib/gkrellm
-rw-r--r-- ianmacd/ianmacd 1230 2002-08-20 00:57:44 bash_completion/contrib/gnatmake
-rw-r--r-- ianmacd/ianmacd 258 2003-12-31 16:22:37 bash_completion/contrib/harbour
-rw-r--r-- ianmacd/ianmacd 1838 2003-12-31 16:22:37 bash_completion/contrib/larch
-rw-r--r-- ianmacd/ianmacd 163 2003-12-31 16:22:37 bash_completion/contrib/lilypond
-rw-r--r-- ianmacd/ianmacd 1917 2003-12-31 16:22:37 bash_completion/contrib/mcrypt
-rw-r--r-- ianmacd/ianmacd 1024 2004-01-01 08:54:41 bash_completion/contrib/mtx
-rw-r--r-- ianmacd/ianmacd 1164 2003-12-31 16:22:37 bash_completion/contrib/p4
-rw-r--r-- ianmacd/ianmacd 1696 2003-12-31 16:22:37 bash_completion/contrib/povray
-rw-r--r-- ianmacd/ianmacd 2613 2006-02-25 22:25:59 bash_completion/contrib/ri
-rw-r--r-- ianmacd/ianmacd 491 2003-12-31 16:22:37 bash_completion/contrib/unace
-rw-r--r-- ianmacd/ianmacd 608 2004-07-06 07:37:47 bash_completion/contrib/unrar
-rw-r--r-- ianmacd/ianmacd 406 2005-01-03 11:00:44 bash_completion/contrib/snownews
-rw-r--r-- ianmacd/ianmacd 8673 2004-03-31 07:05:34 bash_completion/contrib/mailman
-rw-r--r-- ianmacd/ianmacd 664 2004-03-31 07:05:45 bash_completion/contrib/sbcl
-rw-r--r-- ianmacd/ianmacd 644 2004-03-31 07:05:45 bash_completion/contrib/lisp
-rw-r--r-- ianmacd/ianmacd 669 2004-03-31 07:05:45 bash_completion/contrib/clisp
-rw-r--r-- ianmacd/ianmacd 603 2004-03-31 07:05:45 bash_completion/contrib/gcl
-rw-r--r-- ianmacd/ianmacd 6701 2006-03-01 18:45:03 bash_completion/contrib/svk
-rw-r--r-- ianmacd/ianmacd 2215 2005-07-12 01:49:14 bash_completion/contrib/modules
-rw-r--r-- ianmacd/ianmacd 1038 2004-10-17 16:22:09 bash_completion/contrib/bittorrent
-rw-r--r-- ianmacd/ianmacd 3019 2006-02-26 08:25:41 bash_completion/contrib/hg
-rw-r--r-- ianmacd/ianmacd 17992 2000-07-12 17:40:03 bash_completion/COPYING
-rw-r--r-- ianmacd/ianmacd 799 2003-05-01 13:49:58 bash_completion/BUGS
-rw-rw-r-- ianmacd/ianmacd 184573 2006-03-02 00:39:58 bash_completion/Changelog
-rw-r--r-- ianmacd/ianmacd 17005 2006-02-25 22:41:11 bash_completion/README
-rw-r--r-- ianmacd/ianmacd 215739 2006-03-02 00:20:18 bash_completion/bash_completion
-rwxr-xr-x ianmacd/ianmacd 557 2006-02-25 09:37:15 bash_completion/bash_completion.sh
-rw-r--r-- ianmacd/ianmacd 2528 2006-03-02 00:19:26 bash_completion/TODO
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd bash_completion
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.75172
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd bash_completion
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/bash-completion-root bash-completion-ghosts.list
+ install -dm 0755 /var/tmp/bash-completion-root/etc/profile.d
+ install -dm 0755 /var/tmp/bash-completion-root/etc/bash_completion.d
+ install -pm 0644 bash_completion /var/tmp/bash-completion-root/etc/
+ sed -e s@/etc@/etc@g /usr/src/redhat/SOURCES/bash_completion.sh
+ touch -r /usr/src/redhat/SOURCES/bash_completion.sh /var/tmp/bash-completion-root/etc/profile.d/bash_completion.sh
+ install -dm 755 /var/tmp/bash-completion-root/usr/share/bash-completion
+ install -pm 644 contrib/bitkeeper contrib/bittorrent contrib/cksfv contrib/clisp contrib/dsniff contrib/freeciv contrib/gcl contrib/gkrellm contrib/gnatmake contrib/harbour contrib/hg contrib/isql contrib/larch contrib/lilypond contrib/lisp contrib/mailman contrib/mcrypt contrib/modules contrib/mtx contrib/p4 contrib/povray contrib/ri contrib/sbcl contrib/sitecopy contrib/snownews contrib/svk contrib/unace contrib/unrar /var/tmp/bash-completion-root/usr/share/bash-completion
+ cd contrib
+ for f in '*'
+ ln -s /usr/share/bash-completion/bitkeeper /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/bitkeeper'
+ for f in '*'
+ ln -s /usr/share/bash-completion/bittorrent /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/bittorrent'
+ for f in '*'
+ ln -s /usr/share/bash-completion/cksfv /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/cksfv'
+ for f in '*'
+ ln -s /usr/share/bash-completion/clisp /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/clisp'
+ for f in '*'
+ ln -s /usr/share/bash-completion/dsniff /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/dsniff'
+ for f in '*'
+ ln -s /usr/share/bash-completion/freeciv /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/freeciv'
+ for f in '*'
+ ln -s /usr/share/bash-completion/gcl /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/gcl'
+ for f in '*'
+ ln -s /usr/share/bash-completion/gkrellm /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/gkrellm'
+ for f in '*'
+ ln -s /usr/share/bash-completion/gnatmake /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/gnatmake'
+ for f in '*'
+ ln -s /usr/share/bash-completion/harbour /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/harbour'
+ for f in '*'
+ ln -s /usr/share/bash-completion/hg /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/hg'
+ for f in '*'
+ ln -s /usr/share/bash-completion/isql /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/isql'
+ for f in '*'
+ ln -s /usr/share/bash-completion/larch /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/larch'
+ for f in '*'
+ ln -s /usr/share/bash-completion/lilypond /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/lilypond'
+ for f in '*'
+ ln -s /usr/share/bash-completion/lisp /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/lisp'
+ for f in '*'
+ ln -s /usr/share/bash-completion/mailman /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/mailman'
+ for f in '*'
+ ln -s /usr/share/bash-completion/mcrypt /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/mcrypt'
+ for f in '*'
+ ln -s /usr/share/bash-completion/modules /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/modules'
+ for f in '*'
+ ln -s /usr/share/bash-completion/mtx /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/mtx'
+ for f in '*'
+ ln -s /usr/share/bash-completion/p4 /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/p4'
+ for f in '*'
+ ln -s /usr/share/bash-completion/povray /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/povray'
+ for f in '*'
+ ln -s /usr/share/bash-completion/ri /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/ri'
+ for f in '*'
+ ln -s /usr/share/bash-completion/sbcl /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/sbcl'
+ for f in '*'
+ ln -s /usr/share/bash-completion/sitecopy /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/sitecopy'
+ for f in '*'
+ ln -s /usr/share/bash-completion/snownews /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/snownews'
+ for f in '*'
+ ln -s /usr/share/bash-completion/svk /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/svk'
+ for f in '*'
+ ln -s /usr/share/bash-completion/unace /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/unace'
+ for f in '*'
+ ln -s /usr/share/bash-completion/unrar /var/tmp/bash-completion-root/etc/bash_completion.d
+ echo '%ghost /etc/bash_completion.d/unrar'
+ cd -
/usr/src/redhat/BUILD/bash_completion
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: bash-completion-20060301-1
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.28530
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd bash_completion
+ DOCDIR=/var/tmp/bash-completion-root/usr/share/doc/bash-completion-20060301
+ export DOCDIR
+ rm -rf /var/tmp/bash-completion-root/usr/share/doc/bash-completion-20060301
+ /bin/mkdir -p /var/tmp/bash-completion-root/usr/share/doc/bash-completion-20060301
+ cp -pr BUGS COPYING README TODO Changelog /var/tmp/bash-completion-root/usr/share/doc/bash-completion-20060301
+ exit 0
Provides: config(bash-completion) = 20060301-1
Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(pre): /bin/sh
Requires: /bin/sh bash >= 2.05-12 config(bash-completion) = 20060301-1 fileutils grep sed textutils
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/bash-completion-root
Wrote: /usr/src/redhat/RPMS/noarch/bash-completion-20060301-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.85514
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd bash_completion
+ rm -rf /var/tmp/bash-completion-root
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.85514
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf bash_completion
+ exit 0
[root@rhel55 setup]#
使用rpmbuild编译后的rpm包在/usr/src/redhat/RPMS下,找到它,然后安装。
[root@rhel55 setup]# cd /usr/src/redhat/
BUILD/ RPMS/ SOURCES/ SPECS/ SRPMS/
[root@rhel55 setup]# cd /usr/src/redhat/ RPMS/
[root@rhel55 RPMS]# find . -name "bash-completion*rpm"
./noarch/bash-completion-20060301-1.noarch.rpm
[root@rhel55 RPMS]# rpm -ivh ./noarch/bash-completion-20060301-1.noarch.rpm
Preparing... ########################################### [100%]
1:bash-completion ########################################### [100%]
[root@rhel55 RPMS]# rpm -qa | grep bash
bash-3.2-24.el5
bash-completion-20060301-1
[root@rhel55 RPMS]# rpm -q bash-completion
bash-completion-20060301-1
[root@rhel55 RPMS]#
[root@rhel55 RPMS]#
安装成功了,退出重新登录。
[root@rhel55 RPMS]# exit
logout
下面的粗体的 TAB 表示按TAB键补全。
Last login: Thu Oct 28 13:19:28 2010 from 192.168.6.106
[root@rhel55 ~]# grep --TAB
--after-context= --count --fixed-strings --max-count= --silent
--basic-regexp --devices= --help --mmap --unix-byte-offsets
--before-context= --directories= --ignore-case --no-filename --version
--binary --exclude= --include= --no-messages --with-filename
--binary-files= --exclude-from= --invert-match --null --word-regexp
--byte-offset --extended-regexp --label= --null-data
--color --file= --line-buffered --only-matching
--colour --files-with-matches --line-number --perl-regexp
--context= --files-without-match --line-regexp --regexp=
[root@rhel55 ~]# cvs a TAB
add admin annotate
[root@rhel55 ~]# cvs a
示例二 在ssh命令后按tab键,bash会根据known_hosts中定义的主机自动补全
[root@web ~]# ssh 1TAB 92.168.6.1TAB
192.168.6.11 192.168.6.12
[root@web ~]# ssh 192.168.6.1
示例三 在service命令后按tab键,bash会自动根据/etc/init.d中的脚本名称自动补全
注意输入service命令之后输入空白再按TAB键,因为是用来补全参数的。如果输入service之后立即按TAB键,bash会认为是要补全命令。
[root@web ~]# service TAB
Display all 100 possibilities? (y or n)
acpid cvs hplip mdmonitor psacct sshd
anacron daytime-dgram ip6tables mdmpd rawdevices syslog
apmd daytime-stream ipmi messagebus rdisc tcpmux-server
atd discard-dgram iptables microcode_ctl readahead_early tftp
auditd discard-stream irda multipathd readahead_later time-dgram
autofs dnsmasq irqbalance netconsole restorecond time-stream
avahi-daemon dund isdn netfs rhnsd tomcat
avahi-dnsconfd echo-dgram jexec netplugd rmcp vncserver
bluetooth echo-stream kdump network rpcgssd wdaemon
capi eklogin killall NetworkManager rpcidmapd winbind
chargen-dgram ekrb5-telnet klogin nfs rpcsvcgssd wpa_supplicant
chargen-stream firstboot krb524 nfslock rsync xfs
conman gpm krb5-telnet nscd saslauthd xinetd
cpuspeed gssftp kshell ntpd sendmail ypbind
crond haldaemon kudzu pand setroubleshoot yum-updatesd
cups halt lvm2-monitor pcscd single
cups-config-daemon hidd mcstrans portmap smartd
[root@web ~]# service
示例四 在cvs命令后按tab键,会显示cvs自带的指令
[root@web ~]# cvs TAB
add ci diff freeze import patch rdiff rm tag --version
admin co -e get -l -q release rtag unedit -w
annotate commit edit -H log -Q remove stat up -x
-b -d export --help -n -r rfreeze status update -z
checkout delete -f history new rcs rlog -t -v
[root@web ~]# cvs
问题思考
1. 查看/etc/bash-completion文件,还会发现哪些命令的参数可以自动补全?
2. 怎样自行扩展一些命令参数的补全方式?
相关资料
【1】在路上 bash complete
【2】Working more productively with bash 2.x/3.x Download
【3】比特网 提高Linux系统命令行的工作效率
相关推荐
使用 complete -p | less 命令可以查看现有的 bash 补全命令。 3.Bash 中标准补全的列表 Bash 为 Linux 用户默认提供了以下标准补全命令: * 变量名补全(Variablename completion) * 用户名补全(Username ...
以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发网~ 您可能感兴趣的文章:浅谈linux中shell变量$#,$@,$0,$1,$2的含义解释php $_SERVER windows系统与linux...
linux-shell-scripting-fundamentals-bash.epub
**pip-bash-completion:为pip提供bash命令行补全** 在Linux或Unix环境中,Bash Shell是一个广泛使用的命令行解释器,它提供了强大的交互式功能。`pip`是Python的包管理工具,用于安装、升级和管理Python库。为了...
centos6的yum源里面没有bash-completion的包,需要单独下载安装。centos7的yum源里面已包含此安装包,可以通过yum直接安装。 **安装步骤** 1、rpm -ivh bash-...2、退出当前命令行,重新连接,即可使用bash命令补全
bash下bash-completion包则提供了tab键补充二级命令的功能,其本质是在/etc/bash-completion.d/目录下创建了相应的tab键补全策略,可以手动添加自定义的补全功能。
在 Linux 系统中,经常会遇到 "bash: command not found" 的错误提示,这是因为系统无法找到相应的命令所致。解决这个问题的关键就在于理解 Linux 系统中的 PATH 变量。 PATH 变量是 Linux 系统中的一种环境变量,...
10.3.1 Shell基础-Bash基本功能-历史命令与补全.mp4 10.3.2 Shell基础-Bash基本功能-别名与快捷键.mp4 10.3.3 Shell基础-Bash基本功能-输入输出重定向.mp4 10.3.4 Shell基础-Bash基本功能-多命令顺序执行与管道符...
linux服务器用户登录后显示-bash问题l
### Linux date 命令详解 #### 一、概述 `date`命令是Linux系统中一个非常实用且强大的工具,用于显示或设置系统的日期与时间。对于系统管理员来说,掌握`date`命令的使用方法至关重要,它可以帮助我们精确地管理...
在Linux系统中,Bash(Bourne-Again SHell)是默认的命令行解释器,用户通过它来执行各种操作。为了提高工作效率,了解如何为Bash添加路径快速切换方法以及实现跨shell同步路径是至关重要的。下面将详细介绍这两个...
3. Shell 扩展:Bash 支持多种扩展,如通配符扩展、波浪号扩展(`~`),用于快速定位用户的主目录、参数扩展、命令替换和算术扩展,极大地增强了脚本的功能和灵活性。 六、总结 Bash 参考手册为用户提供了全面的 ...
Linux运维-3.Shell编程-11shell基础-103Bash基本功能2.avi
Linux运维-3.Shell编程-11shell基础-102Bash基本功能1.avi
Linux运维-3.Shell编程-11shell基础-104Bash基本功能3.avi
在Linux系统中,Bash(Bourne-Again SHell)是默认的命令行解释器,也是许多系统管理员和开发者日常工作中最常用的工具之一。它不仅用于执行单一的命令,还可以通过编写脚本来实现自动化任务。这个名为"linux-用bash...
根据提供的文件信息,我们可以推断出这是一份关于MySQL 5.6.39在Linux 64位系统上的预编译二进制版本的资料。下面将详细解析与该文件相关的知识点,包括MySQL 5.6.39版本的特点、安装部署方法以及可能遇到的一些常见...
10.3.1 Shell基础-Bash基本功能-历史命令与补全 10.3.2 Shell基础-Bash基本功能-别名与快捷键 10.3.3 Shell基础-Bash基本功能-输入输出重定向 10.3.4 Shell基础-Bash基本功能-多命令顺序执行与管道符 10.3.5.....
docker-machine-completions Bash脚本为docker-machine提供补全受到Docker原始完成启发。 要启用完成功能: 将此文件复制到/etc/bash_completion.d中source直接将文件将此文件复制到给定位置(例如~/comps/docker-...
在 CentOS 下新增一个用户,登录进去之后 shell 脚本的信息如下:bash-4.1$,而不是我们经常看到的 username@hostname 的组合,看起来很不舒服。 解决方案 问题的原因是因为没有配置 .bash_profile 的问题,可以...