Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my sudo command, if I don't mention username, will it take root as the default user? For example, In the following command-

sudo mkdir /tmp/computerLinux/

using which target user will it execute the command?

share|improve this question

migrated from stackoverflow.com Aug 20 '13 at 8:31

This question came from our site for professional and enthusiast programmers.

3  
sudo means "root user". So, it will obviously take the credentials of the "root" account. –  palerdot Aug 20 '13 at 6:06
1  
@palerdot: Yet the headline of the man page reads: "sudo - execute a command as another user" :-) –  NPE Aug 20 '13 at 6:11

1 Answer 1

up vote 3 down vote accepted

Yes, from manual of sudo:

-u The -u (user) option causes sudo to run the specified command as a user other than root. To specify a uid instead of a username, use #uid.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.