How to Run a Command as Another User on Ubuntu (sudo -u)
sudo -u runs a command as another user on Ubuntu. This guide shows its syntax and a three-step example with whoami, with real output from Ubuntu 26.04.
- Operating Systems
- Linux
- Ubuntu
sudo -u runs a command as another user on Ubuntu. This guide shows its syntax and a three-step example with whoami, with real output from Ubuntu 26.04.
sudo apt update refreshes Ubuntu's package lists before you install or upgrade software. Here's what it does and what its output means, with real output.
One command, lsb_release -a, shows which Ubuntu version you're running: its release number, its full name and its code name.