The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference between : Locked User Account & Disabled User Accounts in Linux ? avklinux UNIX for Dummies Questions & Answers 3 02-06-2009 09:01 PM
single user mode - user accounts passwords orestis UNIX for Dummies Questions & Answers 3 02-02-2009 05:18 PM
Running script from other user rather than login user rawatds Shell Programming and Scripting 3 01-30-2009 01:18 PM
How do i change to super user then revert back to ordinary user ,using shell script? wrapster Shell Programming and Scripting 3 06-04-2008 07:11 AM
Other than root user .Normal user is unable to create files mallesh UNIX for Advanced & Expert Users 1 06-22-2005 12:18 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-26-2009
matvrix matvrix is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 5
su <user> or su - <user>

Besides the profile being loaded for the later, what other privileges are obtained ?
  #2 (permalink)  
Old 06-26-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 968
su - creates a login shell - it's more like logging in that with just su.

See the difference:

Code:
/root # su oracle
/root # echo $0
ksh
^d
/root # 
/root # su - oracle
/home/oracle > echo $0
-ksh
/home/oracle >
  #3 (permalink)  
Old 06-26-2009
TonyLawrence TonyLawrence is online now
Registered User
  
 

Join Date: Sep 2007
Location: SE Mass
Posts: 68
Usually the reason for "-" is that you want the same environment you'd get by logging in as that user, $PATH especially.

Use "-" when you need to know what happens when "sam" logs in: su - sam is going to run sam's shell startup files etc.
Sponsored Links
Reply

Bookmarks

Tags
su

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0