===================================== Directories: current, HOME, and /home ===================================== -IAN! idallen@ncf.ca Some people are still confused about: - "your HOME directory" - the directory given to you by the system administrator and into which you are placed when you first log in - this is the directory you go to when you type "cd" with no arguments - the name of your home directory is available in the shell keyword variable named "$HOME" (HOME is UPPER CASE) - on many Unix systems, your home directory is a directory under /home e.g. /home/abcd0001, /home/zyxw0002, etc.; but, this is not always true - /home - a pathname (probably a directory) under the root directory, named "home" - this is NOT your HOME directory; it is (usually) a directory named /home - (/home might be a file name, not a directory; but, this is rare) - some other names (directories) under root are /etc, /bin, and /usr - "current directory" - the directory that your shell (or any Unix process) is currently in - relative pathnames are relative to this current directory - the name of this directory is always "." (dot) - the current directory of a shell can be changed by using the "cd" command - every process has its own current directory; changing current directory in one process does not change it for other processes - the current directory is passed on to child processes when they are first started (e.g. to shell scripts that you invoke) - changing directories inside a shell script will not affect the parent process that called the shell script (different processes) Problem: "Put the date into a file out.txt in the current directory." Solution: date >out.txt Problem: "Put the date into a file out.txt in your HOME directory." Solution: date >"$HOME"/out.txt Problem: "List the names (including hidden names) in the /home directory." Solution: ls -a /home