What if you could switch users instantly without logging out and losing your place?
Why su (switch user) in Linux CLI? - Purpose & Use Cases
Imagine you are working on a shared computer where you need to perform tasks as different users. You have to log out and log back in every time you want to switch users to run commands or access files.
This manual method wastes time and interrupts your workflow. Logging out and back in repeatedly is slow and frustrating. It also increases the chance of mistakes, like forgetting to save work or closing important programs.
The su command lets you switch users instantly within the same session. You can run commands as another user without logging out, saving time and reducing errors.
logout
login as another user
run commandssu username run commands as that user exit # to return
You can quickly and safely switch user identities to manage tasks without interrupting your work.
A system administrator needs to switch to the root user to install software, then switch back to their regular user to continue daily work--all without logging out.
Manually switching users by logging out is slow and error-prone.
su lets you switch users instantly in the same session.
This saves time and keeps your workflow smooth and safe.