LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2013, 12:33 AM   #1
junior-s
Member
 
Registered: Apr 2013
Location: Brazil
Distribution: Arch Linux
Posts: 137

Rep: Reputation: Disabled
'su' vs 'su -' - What's the difference?


What's the difference between these two:

Code:
su
and
Code:
su -
Regards.
 
Old 09-16-2013, 12:54 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
see the man page:
-, -l, --login
make the shell a login shell

with - the new shell will be a login shell therefore a new environment will be set.
without - the new shell will inherit the environment from the parent.
 
2 members found this post helpful.
Old 09-16-2013, 03:32 AM   #3
bebetter
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Rep: Reputation: Disabled
-l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above.
USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is
the target login's, and su will change directory to the target login's home directory.

- (no letter) The same as -l.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Making a Difference; Selling a Difference LXer Syndicated Linux News 0 09-23-2010 05:00 AM
shell script to find the difference betwwn two file and place the difference to other kittunot4u Linux - General 3 07-19-2010 04:26 AM
difference between wc -c and -m kpraveen455 Linux - General 2 07-14-2009 01:38 AM
what is the difference minhajhussan Linux - Distributions 4 04-27-2008 07:59 AM
tell me the difference wood Programming 8 01-31-2004 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration