Linux su Command

In this tutorial we learn how to use su commmand in Linux. su command is su - run a command with substitute user and group ID For backward compatibility, su defaults to not change the current directory and to only set the environment variables HOME and SHELL (plus USER and LOGNAME if the target user is not root). It is

What is Linux su Command?

In this tutorial we learn how to use su command in Linux. su command is su - run a command with substitute user and group ID For backward compatibility, su defaults to not change the current directory and to only set the environment variables HOME and SHELL (plus USER and LOGNAME if the target user is not root). It is

su Syntax

       su [options] [-] [user [argument...]]

su Examples

su Command Manual / Help

We can use man and info command to see the manual page of su command.

su command also have --help option to show list of options.

To open man page for su command we can use command below. To exit man or info page you can press q.

man su

To open info page for su command we can use command below.

info su

To open help page from su command we can run command below.

su --help

Linux su Command Source Code

You can find su command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use su in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.