autocomplete commands with sudo
How to enable autocomplete when using sudo command?
Edit the ".bashrc" hidden file from your home folder.
Then paste this at the bottom of the file:
Then type this in a terminal to reload:
Now try the example in the beginning of the file "sudo ser" and press TAB.
It should now work.
found at: http://www.webupd8.org/2010/03/how-to-autocomplete-commands-preceded.html
Edit the ".bashrc" hidden file from your home folder.
sudo vim ~/.bashrc
Then paste this at the bottom of the file:
if [ "$PS1" ]; then
complete -cf sudo
fi
Then type this in a terminal to reload:
bash
Now try the example in the beginning of the file "sudo ser" and press TAB.
It should now work.
found at: http://www.webupd8.org/2010/03/how-to-autocomplete-commands-preceded.html
Thanks, I always forget this.
ReplyDelete