Tag Info

New answers tagged

1

Yes. The POSIX specification requires the OS to set a value for $HOME: HOME The system shall initialize this variable at the time of login to be a pathname of the user's home directory. See pwd.h. What about user nobody? # su - nobody No directory, logging in with HOME=/ $ echo $HOME / Even though nobody has no true home, HOME is ...


6

You need to quote it to protect it from shell expansion. ls ~ # list your home directory ls "~" # list the directory named ~ ls \~ # list the directory named ~ Same thing with rm, rmdir, etc. The shell changes ~ to /home/greg before passing it to the commands, unless you quote or escape it. You can see this with echo: anthony@Zia:~$ echo ~ ...


15

This change was introduced by BSD after 1985 (BSD 4.2 was still documenting /usr) and in or before 1988 (BSD 4.3/SunOS 4.1 hier(7) manual page already documents /home). It was quickly followed by Solaris 2.0 (which kind of merged System V and BSD) and was later adopted by most other Unix vendors. This is from the Solaris 2.0 useradd manual page: -D ...



Top 50 recent answers are included