bash
การใช้งาน bash autocomplete บน Linux ช่วยอำนวยความสะดวกในการทำงานเป็นอย่างมาก และสำหรับผมแล้วเป็นสิ่งที่จำเป็นที่ต้องมี เพราะช่วยให้สามารถใช้งานคำสั่งต่างๆ ได้อย่างรวดเร็ว

ในบทความนี้จะนำเสนอ bash autocomplete เสริมสำหรับการใช้งานที่สะดวกเพิ่มมากขึ้น โดย bash autocomplete จะรองรับการทำงานกับกลุ่มคำสั่งด้านล่างนี้

aspell iconv postgresql
autoconf iftop procps
automake ifupdown python
bash-builtins info rcs
bind-utils iproute2 redefine_filedir
brctl ipsec rpcdebug
bzip2 iptables rpm
chkconfig isql rsync
configure jar screen
coreutils java service
cpio lsof sh
crontab lvm shadow
cryptsetup lzma sqlite3
cvs lzop ssh
cvsps make strace
dd man subversion
dhclient mcrypt tar
e2fsprogs mdadm tcpdump
fcoeadm module-init-tools tuned-adm
fcoemon mutt unrar
findutils mysqladmin util-linux
fuse net-tools vncviewer
gcc ntpdate xmllint
gdb open-iscsi xmlwf
genisoimage openldap xorg-x11-server-utils
getent openssl xsltproc
git perl xz
gpg2 pk-completion.bash yum
guestfish-bash-completion.sh pkg-config yum-utils.bash
gvfs-bash-completion.sh pm-utils
gzip postfix

การใช้งาน bash autocomplete

command [TAB]
command arg[TAB][TAB]

ตัวอย่างการใช้งาน bash autocomplete

[root@Ezylinux root]# man ls[TAB][TAB]
ls lscpu lshal lspci
lsassd_selinux lsdiff lshw lssubsys
lsattr lsearch lsmod
lsblk lset lsof
lscgroup lsetfilecon lsort

[root@Ezylinux root]# chkconfig h[TAB][TAB]
haldaemon halt httpd

[root@Ezylinux root]# chkconfig httpd [TAB][TAB]
off on reset resetpriorities

[root@Ezylinux root]# yum in[TAB] ly[TAB][TAB]
lynx.x86_64 lyx-common.noarch lyx-fonts.noarch lyx.x86_64

การติดตั้ง bash autocomplete

[root@Ezylinux root]# yum install -y bash-completion

เมื่อติดตั้งเสร็จให้ทำการรันคำสั่งด้านล่างเพื่อทำการ activate ใช้งาน bash_completion
[root@Ezylinux root]# source /etc/bash_completion

หรือ สามารถ Logout ออกจากระบบ และ login ใหม่อีกครั้งก็ได้