|
|
Allanm
|
For sometime now, I am unable to do -
cd ~homedir
but
cd /homedir works...
Can you suggest some pointers as to how I can troubleshoot or fix this?
Thanks,
Allan.
|
|
|
Note: If you are the author of this question and wish to assign points to any of the answers, please login first.For more information on assigning points ,click
here
|
|
|
Sort Answers By:
Date or Points
|
|
|
Allanm
|
|
Nov 2, 2009 23:47:25 GMT
N/A: Question Author
|
|
|
Also sudo bash takes a very long time to come back to the password prompt... |
|
Steven Schweda
|
|
Nov 3, 2009 00:00:04 GMT
Unassigned
|
|
> cd ~homedir
If you want "/homedir", then say "/homedir". The "~user_name" notation is used with a user name. That path to that user's home directory is obtained from the "passwd" data base ("/etc/passwd", or wherever). Unless there's a user name of "homedir", "~homedir" makes no sense.
What is the user name here?
Where is that user's home directory? |
|
|
Allanm
|
|
Nov 3, 2009 00:05:41 GMT
N/A: Question Author
|
|
Sorry I meant cd ~user-home-dir, cd /user-home-dir works.
Also sudo bash is very slow to respond... |
|
Steven Schweda
|
|
Nov 3, 2009 03:50:14 GMT
Unassigned
|
|
> Sorry I meant cd ~user-home-dir, > cd /user-home-dir works.
So, does that mean that you're happy, or is there still a problem/question there?
> Also sudo bash is very slow to respond...
A different thread with "sudo" in the Subject might get more attention from people who know more about sudo than I. |
|
Goran Koruga
|
|
Nov 3, 2009 06:10:40 GMT
Unassigned
|
|
Hi.
Did you check which is the homedir set for your user?
getent passwd <username>
Next to last field is homedir.
Regards, Goran |
|
Kapil Jha
|
|
Nov 3, 2009 11:48:24 GMT
Unassigned
|
|
its ~user_id if your user id existe and it has home dir.
have you seen some other problem or some specific thing when you not able to do this. BR, Kapil+ |
|
Matti Kurkela
|
|
Nov 3, 2009 12:39:18 GMT
Unassigned
|
|
When you execute "cd ~foo", the shell checks the home directory location of user "foo" from the user database (usually /etc/passwd, but can be NIS or LDAP too if configured) and then moves to that directory.
If the user "foo" has his home directory set as /home/bar, the command "cd ~foo" moves to /home/bar.
Since you say your "cd /homedir" works, it is probably not a home directory permission problem.
Maybe the user cannot look up the home directory location for some reason? What are the permissions of /, /etc and /etc/passwd?
Please run:
ls -ld / /etc /etc/passwd
The response should be something like this. Note the permissions: drwxr-xr-x 25 root root 4096 2009-10-20 13:30 / drwxr-xr-x 162 root root 16384 2009-11-03 12:57 /etc -rw-r--r-- 1 root root 1854 2009-10-06 15:18 /etc/passwd
MK |
|
Dirk Dierickx
|
|
Nov 5, 2009 08:48:28 GMT
Unassigned
|
|
normally 'cd ~' will take you to your own home dir. 'cd ~userhomedir' will not work because that would translate to something like /home/user/user, which probably doesn't exist.
if you want to do 'cd ~otheruserhomedir', i'm not aware this is possible. afaik ~ always points to your own home dir and thus you should address others home dirs always as a full path. |
|
Steven Schweda
|
|
Nov 5, 2009 15:13:05 GMT
Unassigned
|
|
> [...] 'cd ~userhomedir' will not work > because [...]
For a valid explanation of what this means, see Matti Kurkela's response.
> [...] i'm not aware [...]
Try it?
debi# cd ~ debi# pwd /root debi# cd ~ftp debi# pwd /home/ftp
debi# grep '^ftp:' /etc/passwd ftp:x:110:65534::/home/ftp:/bin/false
Or read about it. "man <your_shell>" should provide the details. |
|
Dirk Dierickx
|
|
Nov 6, 2009 08:20:24 GMT
Unassigned
|
|
|
nice, didn't know about that one yet! is there anything unix can't do? :) |
|