![]() This command is often used to perform administrative tasks as the root user without affecting the current environment.It requires the user to enter the root user’s password to authenticate.This command switches the user to the root user account without changing the current environment variables or the current directory.This command is often used to execute commands as the root user.It also changes the current directory to the root user’s home directory.This command switches the user to the root user account and sets the environment variables to those of the root user.The significant differences between the two are: su – Commands The “su -” and “su root” commands in Linux are used to switch to the root user account. Difference Between “su -” and “su root” Commands This also represents the difference between the su – and su root. The output above shows that the user has been switched to root but the home directory is of the current user. To switch to the root user and run a command with root privileges, use the basic “su -” command: Here are some examples of su – commands in Linux: Example 1: Switch to the Root User Using the “su -” Command It means that it loads the environment of the target user, including the home directory, PATH, and other environment variables. The “ su –” command is utilized to switch to the root user account and create a login shell session. What is the Difference Between “su -” and “su root” Commands?. ![]() To explore that, this post will address the difference between the “su -” and the “su root” as follows: ![]() Among the “su” command options, the “su -” and “su root” are used to switch to root user with some distinctive features. When used with the “ –” option or followed by a user name like “ su root”, it allows the user to assume the privileges of the target user. In Linux, the “ su” command is utilized to switch to another user account from the current one.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |