Bash Autocomplete feature on CentOS Linux
การใช้งาน bash autocomplete บน Linux ช่วยอำนวยความสะดวกในการทำงานเป็นอย่างมาก และสำหรับผมแล้วเป็นสิ่งที่จำเป็นที่ต้องมี เพราะช่วยให้สามารถใช้งานคำสั่งต่างๆ ได้อย่างรวดเร็ว
ในบทความนี้จะนำเสนอ bash autocomplete เสริมสำหรับการใช้งานที่สะดวกเพิ่มมากขึ้น โดย bash autocomplete จะรองรับการทำงานกับกลุ่มคำสั่งด้านล่างนี้
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
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
1 2 3 4 |
command [TAB] command arg[TAB][TAB] |
ตัวอย่างการใช้งาน bash autocomplete
1 2 3 4 5 6 7 8 |
[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 |
1 2 3 4 |
[root@Ezylinux root]# chkconfig h[TAB][TAB] haldaemon halt httpd |
1 2 3 4 |
[root@Ezylinux root]# chkconfig httpd [TAB][TAB] off on reset resetpriorities |
1 2 3 4 |
[root@Ezylinux root]# yum in[TAB] ly[TAB][TAB] lynx.x86_64 lyx-common.noarch lyx-fonts.noarch lyx.x86_64 |
การติดตั้ง bash autocomplete
1 2 3 |
[root@Ezylinux root]# yum install -y bash-completion |
เมื่อติดตั้งเสร็จให้ทำการรันคำสั่งด้านล่างเพื่อทำการ activate ใช้งาน bash_completion
1 2 3 |
[root@Ezylinux root]# source /etc/bash_completion |
หรือ สามารถ Logout ออกจากระบบ และ login ใหม่อีกครั้งก็ได้