Home > Uncategorized, Unix > su vs sudo command

su vs sudo command

The command su (short for substitute user) is used to switch user in UNIX environment. When we issue su command  with/without a username, it switches to root or otherwise user mentioned.


On the other hand, sudo command run a single command with root privilege. By leveraging sudo, the system discourages to switch to root user when it is not absolutely necessary.


We can su with -c  to achieve the same as sudo command.



#Prosunjit Biswas#


Categories: Uncategorized, Unix
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: