What is the Difference between 'su' and 'su-' ?
Answer Posted / alf55
Answer 2 is the most correct. Really "su" is "switch user"
and its format is "su optional_options optional_username"
where a missing "username" defaults to "root".
The options "-", "-l", and "--login" are all equivalent.
When the "-" is used, the shell is initialized as if logged
into the machine as the specified user (hence you also end
up in your the home directory of "username". Without the
"-", the current environment is left intact but the user has
been switched to that of "username" hence you are still in
the current directory.
From the "man su" page:
{{{
-, -l, --login
Provide an environment similar to what the user
would expect had
the user logged in directly.
When - is used, it must be specified as the last
su option. The
other forms (-l and --login) do not have this
restriction.
}}}
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
How do you copy in linux terminal?
Explain the working of command grouping?
What is difference between egrep and grep?
Which command puts a script to sleep untill a signal is recieved?
What is the ipconfig command for linux?
What is the command to see on which port which service is running?
What is make in linux?
you wish to create a link to the /data directory in bob's home directory so you issue the command ln /data /home/bob/datalink but the command fails. What options hould you use in this command line to be successful.
What is type command in linux?
Write a command that will do the following: -look for all files in the current and subsequent directories with an extension c,v -strip the,v from the result (you can use sed command) -use the result and use a grep command to search for all occurrences of the word orange in the files.
What does f mean linux?
Which command is used to review boot messages?
What is filter command in unix?
What are the basic command in linux?
How do I find the console in linux?