Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-11-2004, 08:50 PM   #1
Registered: Dec 2003
Location: Maryland
Distribution: Fedora Core 1
Posts: 52

Rep: Reputation: 15
bash: su - changes directory to /root


in bash, whenever i do:

>su root

the directory changes to /root but i would like to keep the same directory i had (like /home/something) before the 'su root.' i looked at the shell variables but i don't see any for that specific reason.

which one is it?

Old 06-11-2004, 09:14 PM   #2
Senior Member
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
use :
su -m
and that will keep you in the folder your located in when you change to root
1 members found this post helpful.
Old 06-11-2004, 09:19 PM   #3
Registered: Dec 2003
Location: Maryland
Distribution: Fedora Core 1
Posts: 52

Original Poster
Rep: Reputation: 15


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
BASH : Total directory size xgreen Programming 7 03-04-2013 06:33 AM
[bash] locating script's directory Erhnam Programming 19 02-01-2005 04:45 AM
bash: cd: My: No such file or directory Doug.Gentry Fedora 2 12-05-2004 03:53 PM
bash: ./configure: No such file or directory beerwulf Linux - Newbie 4 08-22-2004 04:50 AM
BASH: How to get current workin directory? gmitra Programming 9 09-20-2003 11:30 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:34 PM.

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