Wednesday, July 8, 2009

Difference between "su" and "su -"

A lot of people don't know the difference [and there is a day light of difference :) ]

==================
su
==================
1. ENVIRONMENT : The environment is the same as that of the user's from which you entered root. In the following example, the environment would be the same as that of user nemesis.


e.g nemesis@tantra:~/device-drivers$su

================================
su -
================================

1. shell reads a relevant startup files and simulates a login

2. ENVIRONMENT: The enviroment is that of the superuser/root and NOT that of the account from you you invoked "su".

For more detailed information, please refer to the man pages.

No comments: