Relative vs. Absolute Path
- Relative is relative to user's pwd.
- Relative starts with '.', '..' or the name of a file or directory in the pwd.
- Absolute starts with '/'. Always.
- Be careful when using relative path.
- NOTE: Tilde path is sometimes correct.
Home vs. Current Directory
- Home Directory
- Fixed
- Owned by user
- Where the user starts when logging in
- Current Directory
- Can change
- Don't know who is the Owner
- pwd
- Might or might not be able to create or delete files. This is something to be aware of when creating scripts.
Referencing Home Directories
- $HOME: system variable that always holds the user's home directory
- ~ and ~user
- Absolute path to the directory: /home/username (Sys Admin controls)
- Relative path