Quote:
Originally posted by apocoloco
What does the "-" do when you type "su -" ?
|
From the manual page for the command su, switch user:
Quote:
bruce@silas:~$ man su
NAME
su - change user ID or become super-user
SYNOPSIS
su [-] [username [args]]
DESCRIPTION
su is used to become another user during a login session. Invoked without a user-
name, su defaults to becoming the super user. The optional argument - may be used
to provide an environment similiar to what the user would expect had the user
logged in directly.
|
So if you "su to root" by issuing "su -" you will change to root's
home directory and root's $PATH; both being "root's environment,"
that you also get when you login as root. If you issue "su root"
the same thing happens.