Directories, Files, and Path Names
In Unix, folders are called directories. Files are still files. The location of a file is called its path. The very top folder (or bottom folder depending on how you think about it) is called the root directory. This root directory is the one you see when you double click your hard drive. It contains the Applications, Library, System, and Users folders.
Here is how you refer to various parts of the file system in Unix:
- The forward slash (
/) refers to the root folder. - A path name beginning with a slash (
/) is an absolute path. For example, the path/Applicationsrefers to the Applications folder, no matter where you currently are. To see a list of Applications, typels /Applications. It doesn’t matter where you currently are because it’s an absolute path. - A path name beginning without a slash is a relative path. For example, if you are currently in your Home folder, the path
Documentsrefers to the Documents folder under your Home folder. While in your Home folder, typels Documentsto see a list of your documents. If you were to typels Applications(without the slash), you’d likely see an error since you (probably) don’t have an Application folder inside your Home folder, and the path is relative to where you currently are. - The tilde (
~) refers to your Home folder. (It’s also an absolute reference, despite not having a preceding slash.) To see what’s in your Home folder, typels ~. To see your own Documents typels ~/Documents. It’s an absolute reference that works from anywhere. For me, the path/Users/richard/Documentsis the same as~/Documents. - You can use the tilde with someone else’s username to refer to their Home folder. For example, to see what’s in Mary’s Home folder, type
ls ~maryor to see what’s in John’s Documents folder, typels ~john/Documents.
You should now be able to refer to any path on your hard drive. Did I leave anything out?

