The su command, which is short for substitute user or switches user, enables the current user to act as another user during the current login session. If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS. It’s a great Linux operating system for beginners. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers, and other devices. About su command: The su command, which is short for substitute user or switches user, enables the current user to act as another user during the current login session. It changes the current user ID to that of a superuser or another user that you specified. Syntax: The syntax is the rule and format of how the su command can be used. These syntax options can be reordered, but a straight format must be followed.,. Below is an example syntax of how to use the su command. Options: The command line options are switches or flags that determined how the commands are executed or controlled. they modify the behavior of the commands. they are separated by spaces and followed after the commands. Below are some options for the su command: Examples: Below are some examples of how to run and use the su on Ubuntu Linux. Simply run the su command to invoke it. If you run the su command but don’t specify a login name, the command automatically switches to the superuser or root and runs its interactive shell. When you run the su command above, you’ll be prompted for the root password. If the root password is authenticated and validated, the user running the command will automatically become root. By default, authentication will fail when you want to change to root since the root account doesn’t have a password created with your installed Ubuntu. To add a password to the root account so you can authenticate, run the commands below When you do that, you’ll be prompted for your password. then continue with asking to create and re-type a new password for the root account. You’ll now be able to use the su command and temporarily becomes root. You can also run the su command with – or -l or –login. This makes the mimic the shell environment similar to a real login, in this case, the root. To run another SHELL instead of the one defined by default in the passwd file, use the -s or –shell option . The below example will use the /usr/bin/zsh shell. When you use su with -c or –command option, it causes the next argument to be treated as a command by most command interpreters. The su command acts almost similarly to the sudo command. However, the sudo command allows users to execute programs with root privileges. On the other hand, the su command gives a temporary root shell to users. But users must know the root password. This could be dangerous when sharing root passwords among users to gain root privileges. In most cases, sudo is used. When you run su with the –help option, you’ll see the help text below: That’s it! Congratulations! You’ve learned how to use the su command on Ubuntu.