Forrest logo
tool overview
On this page you find all important commands for the CLI tool su. If the command you are looking for is missing please ask our AI.


The "su" command is a powerful command line tool in Unix-like operating systems, including Linux and macOS. "su" stands for "Switch User" or "Super User" and allows users to switch to a different user account, including the root (admin) account, on the same terminal session.

  1. The "su" command is typically used for administrative tasks that require elevated privileges.
  2. It is often used when you need to perform system maintenance or make changes that are restricted to system administrators.
  3. By default, the "su" command switches to the root user account, providing full access to all files and commands on the system.
  4. However, it can also be used to switch to other user accounts if you have the necessary permissions.
  5. When running "su" without any arguments, it prompts for the password of the user you wish to switch to.
  6. Once the correct password is entered, the terminal prompt changes to reflect the switched user account.
  7. The "su" command is commonly used in combination with other commands to perform administrative tasks, such as installing software or modifying system configurations.
  8. It is essential to exercise caution when using "su" as any mistakes or unintended commands executed with root privileges can have severe consequences on the system's stability and security.
  9. Some systems may restrict the usage of the "su" command, allowing only specific users or groups access to switch to the root account.
  10. Alternatives to "su" include "sudo" (Superuser Do), which provides a more granular approach to granting temporary administrative privileges to users, and "su -", which provides a more complete environment change when switching users.

List of commands for su:

  • su:tldr:0b180 su: Switch to superuser (requires the root password).
    $ su
    try on your machine
    explain this command
  • su:tldr:44b7c su: Switch to a given user (requires the user's password).
    $ su ${username}
    try on your machine
    explain this command
tool overview