Linux Commands Helper
💬 Your AI-powered Linux assistant
su Command - Switch User
su (substitute user) allows you to switch to another user account in the current session. By default, it switches to the root user if no username is specified.
Syntax
su [options] [username]
Examples
su
Switch to the root user.
su username
Switch to the specified user account.
Notes
- Requires the target user's password.
- Use
su -
to start a login shell as the target user. - For administrative tasks,
sudo
is often preferred oversu
.