Return to the Home direcotry


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Return to the Home direcotry
# 1  
Old 02-16-2006
Return to the Home direcotry

Hi,

New to the UNIX Environment and I think made some mistake, because my cd command is not returning me back to the home directory.

It gives an error

: does not exist

Can anyone help me please.

Please note that I have even tried cd $HOME but got the same error message.

Thanks in advance.

Best Regards
# 2  
Old 02-16-2006
Check that you haven't created an alias for the cd command
% alias |grep cd

Check for your home directory in /etc/passwd - replace your-userid-goes-here with your account name - the awk command will grab the home directory name

% grep "your-userid-goes-here" /etc/passwd |awk -F: '{print $6}'

Check that the output of the home directory actually exist - try using the ls command.
# 3  
Old 02-17-2006
Return to HOME Directory

Quote:
Originally Posted by RTM
Check that you haven't created an alias for the cd command
% alias |grep cd

Check for your home directory in /etc/passwd - replace your-userid-goes-here with your account name - the awk command will grab the home directory name

% grep "your-userid-goes-here" /etc/passwd |awk -F: '{print $6}'

Check that the output of the home directory actually exist - try using the ls command.
Thanks for your reply,

I have checked for alias if any, but there is not.

I have tried the grep command which you have given, which after execution gives me '>' as a prompt.

I have even tried ls command and it gives me output of the home directory.

Will appreciate your view / more guidance.

Thanks and best regards,
# 4  
Old 02-17-2006
The grep command given by RTM should work correctly. Check u are not missing anything in the command.
open /etc/passwd file and check ur home directory there.
Set HOME variable in ur .profile.
# 5  
Old 02-17-2006
Return to HOME Directory

Quote:
Originally Posted by shriashishpatil
The grep command given by RTM should work correctly. Check u are not missing anything in the command.
open /etc/passwd file and check ur home directory there.
Set HOME variable in ur .profile.
Done

Thanks for your help.

Best Regards
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies

2. Shell Programming and Scripting

cp -p /home/* home/exp/*.date not working please help

:( ---------- Post updated at 01:51 AM ---------- Previous update was at 01:50 AM ---------- Not working ---------- Post updated at 02:04 AM ---------- Previous update was at 01:51 AM ---------- cp -p /home/* home/exp/*.`date` i am using this (4 Replies)
Discussion started by: rishiraaz
4 Replies

3. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

4. Programming

how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist

I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories. but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory... (8 Replies)
Discussion started by: platinumedge
8 Replies

5. Linux

Need help w/home network

Hello world! I'm writing to you from Chile, Southamerica, and need a little help with my tiny home netwk. Hope you can give me a hand because this thing is breaking my balls. This is what i have: 1 windows box with XP pro (server) 1 linux box with DSL (box) 1 wrt54gl router with dd-wrt... (1 Reply)
Discussion started by: juanpedro
1 Replies

6. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

7. Shell Programming and Scripting

Script look for file ,sort and copy to other direcotry

Hi I am in a situation to write a shell script that looks for the flat files continuosly and if files exists in that directory sort on the files and get the latest file(File comes with timestamp at the end) and copy the latest file to the other directory and again copy the next one to the same... (0 Replies)
Discussion started by: reddi22
0 Replies

8. Shell Programming and Scripting

$HOME is not getting it's value.

#!/bin/ksh while read line < elig_jobs.txt do #Gets the field from the elig_jobs.txt file that has the input location path. INPUTD=`echo "$line" | cut -c240-289` (ex: $HOME/2005) echo inputdirectory: $INPUTD (this prints $HOME/2005) I want it to print /data/user/2005... (4 Replies)
Discussion started by: radhika
4 Replies

9. UNIX for Advanced & Expert Users

Can't delete a direcotry

Hi, I don't see my new post, so I am post it again: I am having hard time to delete a directory: $ rmdir testdxdwdw $ rm -r testdoxdwdw rm: testoxdwdw non-existent $ rm vtestoxdwdw No such file or directory $ rm -rf vtestoxdwdw ### still don't work Thanks! (0 Replies)
Discussion started by: oradbus
0 Replies

10. Shell Programming and Scripting

can you change direcotry using variables?

is this allowed? cd ../$var inside of a for loop? I want to be able to go into a new folder in the same directory with each iteration of the loop. I want $var to change to the folder number I am trying to get into. (4 Replies)
Discussion started by: jsalz638
4 Replies
Login or Register to Ask a Question