Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the Difference between 'su' and 'su-' ?

Answers were Sorted based on User's Feedback



What is the Difference between 'su' and 'su-' ?..

Answer / ramesh seervi

both command is used for switch the user but su will drop
you on the current directory and su - will drop you on the
user's home directory

Is This Answer Correct ?    45 Yes 2 No

What is the Difference between 'su' and 'su-' ?..

Answer / papseddy

there is little difference in both of these commends...

su --> just switch you to user mode (root) but didn't provide the complete user environment


su - ---> provide you the complete user environment and also direct jump to user home directory.

Is This Answer Correct ?    20 Yes 2 No

What is the Difference between 'su' and 'su-' ?..

Answer / 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

What is the Difference between 'su' and 'su-' ?..

Answer / naresh

SU and SU - doing same job but few diff. is
su <username> is switch user without loading the user environment variable

su -<username> --switch the user with loading the user environment variables.

Is This Answer Correct ?    1 Yes 0 No

What is the Difference between 'su' and 'su-' ?..

Answer / priyanka doiphode

su command is used to switch to local users.
and, su- command is used to switch to 'root user' or 'admin user'

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Linux Commands Interview Questions

How do you check which file consuming more space in linux?

0 Answers  


What is #!/ Bin sh?

0 Answers  


I know ssh, telnet, dns,apache all are worked on TCP/UDP but i want to know any one service which are working on UDP only?

10 Answers   Wipro,


What could possibly be the problem when a command that was issued gave a different result from the last time it was used?

0 Answers  


Working in Linux/Unix platform, if any command dose not work, say # ls reports as command not found. what to do?

5 Answers  


What is kill 9 in linux?

0 Answers  


what are the basic elements of firewall?

2 Answers   Athena Security Solutions, CMC,


What are the basic commands in command prompt?

0 Answers  


How do you change file permissions in Linux?

1 Answers  


What is du command in linux?

0 Answers  


WHAT IS THE MEANING IF AIX

5 Answers   IBM,


what is linux utilities and editor

4 Answers   Oracle, Wipro,


Categories