Nine (point nine) times out of ten, when you login to a *nix computer, you'll start out in the directory /home/xxx, where xxx is your login ID. You have full control of this directory: you can create, edit and delete files and directories there as you see fit. Your dotfiles will also be kept there, and you probably won't venture outside. From your home directory, try the command 'ls ..' or 'ls /home' to see the /home directories of the system's other users.

/home directories have the alias of '~' (the tilde). You can use this alias on the command line. For example, if you have a directory named 'docs' in your /home directory, you can type 'cd ~/docs' to get there from anywhere. If you just want to go to your home directory, you don't even need the ~: just a plain 'cd' will suffice. So if your user name is 'foo', the commands:

  • cd /home/foo
  • cd ~
  • cd
will all perform the same function - return you to your home directory, wherever you might be.

Some services may have /home directories, too, depending on the system configuration. For example, web server files might be placed in /home/httpd.

You may have a directory named public_html or something similar in your /home directory. If you have, anything you place there (and make readable) will be accessible on the machine's web server, under the directory '~xxx', where xxx once again represents your user ID (depending on the server configuration). So if your username is 'foo', and your server's IP address is 123.45.67.89 and you put the file index.html in your public_html directory, it will be accessible via the WWW at the URL:

http://123.45.67.89/~foo/index.html

which maps to the system file:

/home/foo/public_html/index.html

Root users invariably have their home directory in a different location; often /root, and sometimes simply /.