Skip to content

Instantly share code, notes, and snippets.

@tareqy
Created August 30, 2018 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tareqy/8254fb22c0fa814dbe42418c44f87bd7 to your computer and use it in GitHub Desktop.
Save tareqy/8254fb22c0fa814dbe42418c44f87bd7 to your computer and use it in GitHub Desktop.
Add AutoComplete Lists to Linux command Line
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' sshr
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' ping
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' nslookup
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' copymyid
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' scp
PATH=$PATH:$HOME/bin
export PATH
TITLEBAR='\[\e]0;\u@\h\a\]'
export PS1="${TITLEBAR}\[\033[01;32m[\t]\033[01;36m\][\u@\h]\[\033[01;33m\][\w]# \[\033[00m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment