sudo root shell with autocomplete

Working remote on linux systems you might connect using a low privilege user which is allowed to run some basic diagnostic and control commands. Requiring additional access sudo provides a good service.

If you're going deep on system diag and configuring many things, it's quite common to change user context to root. It's quite convenient to do this using sudo su - and this works.

Can i do better?

Yes! Working on recent bash versions you might like that bash supports command completion (https://blog.nuvotex.de/add-bash-command-auto-completion/). Running sudo su won't provide command completion.

The solution: sudo -Es or sudo -s (depending if you want to keep env)

Update: if you want a root session with "full setup" like $HOME path it's better to use sudo -i

This will provide a shell running as the given target user (if no user is passed, root will be selected).

Quite an easy way to get a real root shell with all features.