Wednesday, November 30, 2016

File Hierarchy and Home Directory

File Hierarchy and Home Directory

Directory Structure

In UNIX, all directories are sorted in a hierarchical structure based on the root "/". Unlike UNIX, in MS-DOS and MS-Windows, the directory structure is a separate tree structure for each "drive" (C: driver and its directories, D: driver and its directories, etc.). The symbol used between directories is the '/' (slash) symbol; MS-Dos and MS-Windows use the '\' (backslash) symbol. In this context, "/home/file1" refers to a valid directory and the file1 object located under the home directory under the root directory.





The image above shows basically visualization of the file system hierarchy in Linux.

The /boot directory contains data about linux boot for instance; initrd, vmlinuz. All the configuration files are located in the /etc directory. The directory of /home contains users' home directories. /dev is the directory where the devices in the linux system is located. /tmp is the common write area, every user can write, but nobody can delete anyone's file. /proc is the directory where statistical information about the system can be queried (eg cat /proc/cpuinfo). There are mainly libraries in /var and there are binaries of basic commands in /bin directory.

Home Directory

Each user has his own home directory on the system. User's personal files and user specific configuration files are stored under this directory. The home directory can not be accessed by anyone other than the user and the system administrator unless the user specifically permits it. 

Traditionally, file and directory access control rules are not applied to the system administrator on a UNIX operating system. The system administrator can access the desired file and directory as desired.

Under Linux the predefined home directories are under the /home directory. Unless otherwise specified by the system administrator, a subdirectory is created under the /home directory for each newly defined user. In this context, wwalter is created in the /home/wwalter path of the home directory defined for this user after the user is identified. When the user logs in the system starts working under the home directory.

The system automatically creates the directory as /home/username if it is not entered as a parameter during user addition.
  
Predefined users can not register data in any directory other than the home directory and the /tmp directory, which is defined as the temporary use directory. Software executed by all users and users can save their temporary files to this directory.

Users which there is not enough space in the home directory or users who doesn't want to "pollute" the home directory can save their temporary files in the /tmp directory. This directory is usually cleaned by the system administrator to free up space for new files at regular intervals. So it is not possible to use the /tmp directory for persistent storage.

To read my previous article: User Concept and User Groups 

No comments :

Post a Comment

Comments system

Disqus Shortname