next up previous contents
Next: Navigating the File System Up: The File System Previous: What's in a filename?   Contents

Pathnames

Files are uniquely named in the file system by specifying the path of directories to look in to find the file. For example, the file with the * in figure [*] is named

/u/b/b/bbadger/private/cs367/Prog1.java

This is its absolute path name. (The dashed line in figure [*] represents skipped levels) Notice that we use the forward slash to separate directories in the pathname.

So that you don't need to type the whole path every time you want to access a file, Unix has the concept of a current directory. When you log in, your current directory is your home directory. Files in your current directory may be specified without any pathname attached to the filename. Files in directories below the current directory can be specified with that part of the pathname that begins at the current directory (e.g. if Bob were in his private directory, he could access Prog1.java with cs367/Prog1.java). This is known as using a relative path name.



Michelle Craft 2008-01-23