[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pwd
From: |
Eric Blake |
Subject: |
Re: pwd |
Date: |
Tue, 31 Mar 2009 05:48:47 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jos Collin on 3/31/2009 1:43 AM:
> Hi,
>
> My personal computer is having a sudo user 'collin'. If I log into
> 'collin' and do the following
>
> $cd ~
> $pwd
>
> It prints /home/collin , which is wrong.
How is that wrong? If $HOME (aka ~) is /home/collin, then that is the
right thing to do. pwd doesn't lie.
> But if I log in as root and from the root's home directory if I issue
> a pwd, it prints /root.
If your question is why logging in as collin (even when using sudo) picks
a different $HOME than logging in as root, that is due to how your
/etc/passwd file is set up for assigning the default home directory of the
two different users. But there is nothing pwd can do to change how your
system's user database is set up.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknSAx8ACgkQ84KuGfSFAYC86wCdHudzYkwNDpfRuH/b/6oRkBti
rJ4Anj2fh71wN+gr8i7qHQEjGRMeKIvB
=XU/e
-----END PGP SIGNATURE-----
- pwd, Jos Collin, 2009/03/31