A Linux directory is collection of a files. Directory is used to store the file names and the related information. All the files, whether ordinary, special, or directory are stored in directories. Directory can also contain directory. Linux stores data and programs in files. These are organized in directories.Unix uses a hierarchical structure for organizing files and directories.
The Root Directory
Everything on your Linux system is located under the / directory, known as the root directory. You can think of the / directory as being similar to the C:\ directory on Windows. The root directory contains all other directories, subdirectories, and files on the system. It is denoted by a forward slash (/) . The root directory contains below other directories, subdirectories, and files on the system.
Home Directory
When you first login into linux system, you will access home directory. The root (administrative) user is the only user who has its home directory in a different location by default. The path of the root user is '/root/', where it has control under all the directories and files. The home directory is a subdirectory of the root directory.
You can go in your home directory anytime using the following command.
$cd ~ $ Where ~ is home directory. Suppose you want to go user's home directory, you can use below command.
$cd ~username $
/bin directory
The /bin directory contains the essential user binaries (programs) that must be present when the system is mounted in single-user mode.
/boot directory
The /boot directory contains the files which is used to boot the system.GRUB boot loader’s files and your Linux kernels are stored in /boot directory.
/cdrom directory
The /cdrom directory is a temporary location for CD-ROMs inserted in the system. It is historical mount point for CD-ROMs.
/dev directory
The /dev directory contains devices files which represent devices information for example, /dev/sda represents the first SATA drive in the system.
/etc directory
The /etc directory contains configuration files, which can generally be edited by hand in a text editor. The /etc/ directory has system-wide configuration files – user-specific configuration files are located in each user’s home directory.
/tmp directory
/tmp directory contains temporary files of system. These temporary files are generally deleted whenever your system is restarted.
/run directory
/tmp directory stores sockets and process IDs related application state files.
/var directory
/var directory stores writable variable data files like Log files in /var/log directory
/usr directory
/usr directory stores files related User Binaries & Read-Only Data.
/srv directory
/srv directory contains files related data for services provided by the system.
Comments