autocomplete commands with sudo

How to enable autocomplete when using sudo command?

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

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:


Post a Comment

Popular posts from this blog

How to clean DB from old logs in Magento 1.x

Reduce (shrink) and resize raw disk at Proxmox

Apache 2.4 + mod_wsgi + Python 3.7 + Django installation on Centos 7.10