The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Change users login name spacewalker AIX 9 03-20-2006 08:09 AM
pswd change on sco GUI login qphillips SCO 3 10-03-2005 04:39 AM
How to i change the login banner in obsd 3.3 vip3r BSD 2 10-02-2003 06:22 AM
Login screen change miredale UNIX for Dummies Questions & Answers 2 10-25-2002 06:18 AM
Password change at login???? rrivas UNIX for Dummies Questions & Answers 4 08-12-2002 03:02 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-24-2002
Registered User
 

Join Date: Jan 2002
Posts: 7
Question change login dir

Ok when I log in to my terminal I land in a dir. How can I change the dir that I start from when I login?

Thanks for the help, sure it is a no brainer for you guys

cd
Forum Sponsor
  #2  
Old 01-24-2002
sTorm's Avatar
Registered User
 

Join Date: Jan 2002
Location: Switzerland, Zurich
Posts: 32
You can change the dir in the /etc/passwd file, or use the usermod command.
usermod -d newdir loginname
or
usermod -d newdir -m loginname to move the content of the old dir to the new one.

Last edited by sTorm; 01-24-2002 at 05:32 AM.
  #3  
Old 01-24-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
If this is for the root user, here is something I discovered the other day.

root:/root> cd
root:/root> echo $HOME
/root
root:/root> HOME=/
root:/root> cd
root:/> echo $HOME
/
root:/> HOME=/root
root:/> cd
root:/root>
root:/root> HOME=/usr/local/bin
root:/root> cd
root:/usr/local/bin> HOME=/root
root:/usr/local/bin> cd
root:/root>


There is a variable called $HOME. You can modify it to be what ever you want. When you type "cd" <enter> that is where you will go. As in the example above.

You can make this permanent by putting in the bottom of your .profile. export HOME=/some/dir.

This works for any user, even root and application user IDs.


__________________
My brain is your brain
  #4  
Old 01-28-2002
Registered User
 

Join Date: Jan 2002
Posts: 7
I tried the " usermod " command and it seems that my unix (Mac OSX) does not have this command. Any other options???



thanks
cd
  #5  
Old 01-28-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
UNIX or Apple???...

Are you sure that you are running UNIX or are you running Apple's OSX that is based (coded in) UNIX? OSX was created with UNIX because it is more stable. Unless I am mistaken, you are actually running Apple OS that is built on top of UNIX.

This is like saying that you are running DOS when you are actually running Win98.

Correct me if I am wrong.
__________________
My brain is your brain
  #6  
Old 01-29-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Darwin (the underlying OS in OSX) is based on BSD4.4, so generally speaking, it is Unix.

lorcet222, log in to a command prompt (as root), and execute the following command:

pico /etc/passwd

If you don't have pico, you'll have to use another (harder to use) editor. Anyways, though, look for a line that begins with your username. You'll see something like this:

samba:x:1005:100wner of samba files:/home/samba:/bin/false

Now look in the sixth colon-delimited field (in this case it says /home/samba, yours will be different). That is your home directory - where you will be when you first log in. Now if you change that to another directory, THATS where you'll start. Just be sure that you have the rights to be in that directory.

Let us know how it goes.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0