- Published
- May 17, 2009
Some days ago, i was wondering why bash-completion is not able to auto-complete some command options when logged in as root through su. So i went to #debian at irc.debian.org and asked to the experts. They told me the solution, and it worked perfect.
Su uses a different bash completion method by default. If you want to enable the same one than the users, edit (as root) ~/.bashrc and append the following code to it (or some similar code that you can find on your user's ~/.bashrc):
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fiNow i can type apti[tab] sa[tab] and it auto-completes properly as aptitude safe-upgrade.
P.S.: Happy Internet Day!
P.S.2: I just made some changes to my theme. I hope you like it :) Feedback is welcome.
0 Responses to Su and bash-completion
There are currently no comments.