Need to navigate to HOME directory when I log in


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need to navigate to HOME directory when I log in
# 1  
Old 11-20-2012
Need to navigate to HOME directory when I log in

Hi,
Currently i'm logging as a user say atgdev. When I login it takes me to directory /.
I see the home directory set as /home/atgdev/

I want that when i log in it shud directly go to my home directory i.e /home/atgdev/.

I thought .profile in /home/atgdev/ will be invoked first when i log in. So I had cd $HOME in .profile but still it didn't redirect me to home directory when i log in. Please advice.
# 2  
Old 11-20-2012
How did you see your home directory set?
The fact that /home/atgdev/ exist is not enough...
What does echo $HOME return?
What do you have when you type:
Code:
grep atgdev /etc/passwd

It of course reads a .profile in your home directory if the file exist and you are correctly set...
We dont know your OS nor how the box is configured (local /etc/passwd?, NIS?, LDAP? etc...) so difficult to say more...
# 3  
Old 11-20-2012
Quote:
echo "cd /home/atgdev/" >> /home/atgdev/.profile
# 4  
Old 11-20-2012
Multiple ways to do it, but jabalv is probably the simplest....however that's essentially the same as

Code:
 echo "cd $HOME" >> /home/atgdev/.profile

What does echo $HOME do for you?

It seems like etc/passwd or .profile are sending you directly to root folder. Can you show us your .profile??
# 5  
Old 11-20-2012
Quote:
Originally Posted by phunk
Multiple ways to do it, but jabalv is probably the simplest....however that's essentially the same as

Code:
 echo "cd $HOME" >> /home/atgdev/.profile

What does echo $HOME do for you?

It seems like etc/passwd or .profile are sending you directly to root folder. Can you show us your .profile??
I think he should better use full path as adoption that environment variable not working.
# 6  
Old 11-20-2012
Yea that's why I want to see what
Code:
echo $HOME

returns. I'd also love to see his .profile and /etc/passwd files.

He said he has cd $HOME in his .profile, which leads me to believe that variable is set differently than he realizes.
# 7  
Old 11-20-2012
Thanks everyone for showing so much interest. First of all i'm not setting $HOME. It is already set and i'm not sure how. Even I was of the belief that .profile is invoked first and sets the home directory. But here it's not the case.

Code:
[atgdev@devenv1 /]$ echo $HOME
/home/atgdev
 
[atgdev@devenv1 /]$ cd /home/atgdev
 
[atgdev@devenv1 ~]$ cat .profile
export ORACLE_BASE=/orcl/app/oracle/product
export ORACLE_HOME=/orcl/app/oracle/product/11.2.0.2/db_1
export ORACLE_SID=APRT02D
export PATH=/usr/local/bin:/bin:/usr/bin:/orcl/app/oracle/product/11.2.0.2/db_1/bin
cd $HOME
 
 
[atgdev@devenv1 ~]$ grep atgdev /etc/passwd
atgdev:x:92206:9080:atgdev, DEV.APAC AD_TSS_TRD_ATGDEV_A, I441633, F, 10100601:/home/atgdev:/bin/csh

The variables that i had set in my .profile is not getting set. Some other .profile is getting called i believe which is etting things. Not sure which one. Is there a way to find out?
Code:
[atgdev@devenv1 ~]$ echo $PATH
/bin:/usr/bin:/opt/boksm/bin:/var/cfengine/bin
[atgdev@devenv1 ~]$ echo $ORACLE_BASE
ORACLE_BASE: Undefined variable.


Last edited by Gangadhar Reddy; 11-20-2012 at 09:12 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

2. AIX

Do you need execute permission to navigate to a directory?

i have a user 'bart' which does not belong to apps group (as shown below) and i want him to be able to navigate to TEST directory.. i gave him read access but he cannot get through. when i added execute permission he was able to navigate to TEST drwxr-xr-- 3 draco apps 4096 Apr... (2 Replies)
Discussion started by: chipahoys
2 Replies

3. Shell Programming and Scripting

Script That Can navigate to 3 differents directory & remove files under them

Hi I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ?? /logs logs1 logs2 logs3 Now I need to remove files under logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' . in... (3 Replies)
Discussion started by: Beginner123
3 Replies

4. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

5. UNIX for Dummies Questions & Answers

Viewing Directory Content as You Navigate Directories in UNIX

Hi, Can someone help me figure out how to view directory content while I navigate directories (without having to go to the actual directory and "ls-ing" it)? Is there some keyboard shortcut for this? For instance, it would be useful if I could see the content of a directory when I'm copying... (2 Replies)
Discussion started by: shelata
2 Replies

6. Shell Programming and Scripting

How Do I Navigate To A Directory???

I am trying to install some applications, on my linux OS and all the instructions are tell me that ill have to navigate to the directories and type the link that they provide, but i try typing 'dir' which shows me the directories but to access a particular one i can't remember how??? can anyone... (2 Replies)
Discussion started by: kprescod4158
2 Replies

7. UNIX for Dummies Questions & Answers

Can you navigate ABOVE the home directory?

Hello, How do I navigate to the level ABOVE the home directory? I have the following structure on my drive, bearing in my I'm using a cygwin port on Windows. C:\ C:\cygwin C:\cygwin\bin C:\cygwin\otherfolders C:\cygwin\home (the home directory) C:\cygwin\home\H (my user directory) ... (4 Replies)
Discussion started by: patwa
4 Replies

8. UNIX for Dummies Questions & Answers

home directory

Hi what is the difference between the directory named /home and the user's home directory? can anyone plz reply? really confuse about it!!!!!!!! thank you (1 Reply)
Discussion started by: nokia3100
1 Replies

9. UNIX for Dummies Questions & Answers

cd into home directory ~

I'm trying to cd into a home directory with cd ~username_here and I'm getting the following error: ~username_here: does not exist The directory exists and I can directly go to it via cd /export/home/username_here without any problems. Any suggestions? (4 Replies)
Discussion started by: here2learn
4 Replies
Login or Register to Ask a Question