Techknow Study

UNIX : File Organization

3:15:00 AM Ashish Rana 0 Comments Category :


Files can be organized into a hierarchy of directories. A typical UNIX file organization structure resembles an upside-down tree.
The home directory is a directory assigned to a user. Usually, all files created by the user are within this directory.
The current working directory (.) is the directory in which you are currently located. After you login, your current working directory is your home directory.

The parent directory (..) of a file is the directory which directly encloses the file.
For example: history is the parent directory of week1.notes, week2.notes, and week3.notes
charles is the parent directory of .login, history, calculator, and calculator.c

The root directory (/) is the directory that encloses ALL files and directories; therefore, it has no parent directory.

Because of this hierarchy of directories, it is sometimes necessary to specify the path to a file or directory.
Example: /home/1/charles/history/week1.notes and history/week1.notes are both parameters to the week1.notes file
Note that / is used to separate directory names.

Absolute Pathname: A pathname that starts with / (the root). Since the path always starts at the root, it is correct regardless of what the current working directory is.
Relative Pathname: A path that starts from the current working directory. Any pathname that does not start with / is taken to be a relative pathname.
Example: If the current working directory is /home/1/charles then the absolute and relative pathnames to week1.notes respectively are /home/1/charles/history/week1.notes and history/week1.notes




RELATED POSTS

0 comments