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-' ?

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


Please Help Members By Posting Answers For Below Questions

What is llvm used for?

1034


What are the ms dos commands?

988


How do I run whois command?

976


How do I permanently set ulimit in linux?

904


Explain the linux ‘cd’ command options along with the description?

899


How find ip address linux?

1011


What is linux pwd (print working directory) command?

917


Enlist some linux to file content commands?

999


What is command grouping?

993


What is cpu in linux?

995


What are commands in grammar?

992


What command do you type to find help about the command who?

918


What does (cd dir && command) do?

956


What signal is ctrl c?

912


What does uname command do?

1084