Tuesday, April 7, 2015

bash completion in Ubuntu with root login

If you use sudo in bash to access root privilege when you are required to modify some system settings for example and use TAB key to have bash completion, you are fine.
But sometimes you want to completely switch to superuser you may invoke
su  command. In this case you are not able to use very handy bash TAB completion. To resolve this you should change .bashrc for the root user. Remember that with sudo you are still logged in with your current user not the root. so there is no need to alter bashrc for that user.

To enable it, you have to uncomment the lines in the picture to enable this.

No comments: