Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

Turn on Bash Smart Completion

Posted on June 14, 2012 by Syauqi Wiryahasana
The Bash shell has this sweet feature where you can use the TAB key to auto-complete certain things. For example, when I am in my home directory, the following command: $cd Do[TAB-key] will automatically yield: $cd Documents Though you can use the TAB key to complete the names of files and directories, by default the completion is pretty “dumb”. If you have already typed$cd Dyou would expect that the tab key would cause only the directory names to be completed, but if I try it on my machine, the tab completion tool uses filenames too. To enable smart completion, edit your/etc/bash.bashrcfile. Uncomment the following lines, by removing the # in the beginning of the lines: #if [ -f /etc/bash_completion ]; then # . /etc/bash_completion #fi Now you can use tab completion to power your way through commands. You can even extend bash smart completion to your own favourite commands by using /etc/bash_completion, the “complete” utility and /etc/bash_completion.d . Explaining the nitty-gritty is beyond me. I refer you to the Debian Administration gurus for more information regarding smarter bash completion. via EmbraceUbuntu
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically