Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - SuSE Linux > ARCHIVES - General Questions
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - General Questions If your question doesn't fit in any other category below ask in here.

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 29-Nov-2005, 16:22
lagu2653
Guest
 
Posts: n/a
Default

Is there a way to get to the same directory where you just were after switching to root with "$ su -"? I'm installing MythTV and in the instructions it seems like he has it set up that way. (If I was in /usr/src/packages/RPMS/i686 as user I want to start in /usr/src/packages/RPMS/i686 as root after "$ su -".)
  #2 (permalink)  
Old 29-Nov-2005, 16:24
Elvish Legion
Guest
 
Posts: n/a
Default

Quote:
Is there a way to get to the same directory where you just were after switching to root with "$ su -"? I'm installing MythTV and in the instructions it seems like he has it set up that way. (If I was in /usr/src/packages/RPMS/i686 as user I want to start in /usr/src/packages/RPMS/i686 as root after "$ su -".)
[/b]

Try this link

Clickage
  #3 (permalink)  
Old 30-Nov-2005, 06:27
Zombie13
Guest
 
Posts: n/a
Default

Quote:
Is there a way to get to the same directory where you just were after switching to root with "$ su -"? I'm installing MythTV and in the instructions it seems like he has it set up that way. (If I was in /usr/src/packages/RPMS/i686 as user I want to start in /usr/src/packages/RPMS/i686 as root after "$ su -".)
[/b]
Short answer: no. When you add the dash (-) to su, it runs the users login profile settings, thus logging you in as that user (basically). You get all the environment settings of that user and run that users .profile. If you don't need the user environment, leave the - off, but that may cause issues with what you are doing.

Another option is sudo. Sudo bash would give you a root shell in the current directory. That is generally the way I do things on all my Unix systems. There are a few things I have encountered that don't work properly, but by and large, everything should work with sudo that way.

Hope that helps.

Z.
  #4 (permalink)  
Old 30-Nov-2005, 06:31
BouncingAyatollah
Guest
 
Posts: n/a
Default

Try using just "su", this doesn't execute a login shell for root, i.e. log you in and dump you in your (root's) home directory, it just switches user (which if you don't specify one is root).

Otherwise it's not too painful to do if you need to use "su -" and you're in a desktop environment console. Before you "su" type "pwd", double-click the output, right-click and Copy it. Do the "su -", then type

cd <middle-click or right-click Paste>

and you're back.
 

Bookmarks

Thread Tools
Display Modes

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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2