suBecomes root in the current environment after entering root’s password.
Switches to another user (root by default) in a new shell, optionally as a login shell or for a single command.
sudo apt install util-linuxsuBecomes root in the current environment after entering root’s password.
su -A full root login shell: resets the environment and changes to /root. Usually what you want.
su - <user>A login shell as another user.
Example
su - postgressu -c "<command>" <user>Runs one command as another user.
Example
su -c "whoami" alicesu -s <shell> <user>Uses a specific shell, needed for service accounts whose shell is /usr/sbin/nologin.
Example
sudo su -s /bin/bash www-datasu -p <user>Keeps the current environment variables.
exitLeaves the su shell and returns to your own user.
Prints the effective user name — the first question after landing a shell.
Changes the owner and group of files and directories.
Reports free and used disk space on mounted file systems.
Estimates how much space files and directories use — find what is filling a disk.
Shows total, used and available memory and swap.
The shell built-in that lists, searches and re-runs previous commands, and manages the history file.