Shell 自动补全


1) /etc/passwd

It shows like this
[shell]huxuan:x:1002:1002::/home/huxuan:/bin/bash[/shell]
in format of
[shell]Username:Password:User ID (UID):Group ID (GID):User ID Info:Home directory:Command/shell[/shell]

Make sure the Command/shell is the “/bin/bash” and not the “/bin/sh” which may be the default value.

2) $HOME$/.bashrc or /etc/bash.bashrc
Make sure the code blew is not commented out.

[shell]if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi[/shell]

3) Reference
http://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.