Directories and File System in Linux

By | October 25, 2018

Directories and File System in Linux

Directories and File System in Linux:

In common with other Unix systems and many other operating systems,
Linux disks are organised into a logical tree structure formed of
directories. A directory held within a direcotry is sometimes known
as subdirectory. The base of the tree is known, not unreasonable, as
the root This is represendted by the /(forward slash symbol).
The following diagram shows part of the Linux filesystem(starting from
the root) and shows some common directories found within it:

 

 

some root level directories found on all Linux systems are:

 

/bin

contains executable programs(“binary” files) which make up
the commands of the operating system.

/boot

 

contains files related to booting the system, including the
kernal image file itself.

 

Kernal:

The core of the operating system which is loaded at boot time.

 

/dev

used for special files which represent devices on the system
.Contained in this directory are files representing each hard disk
and partition on the system, each serial and parallel port, a mouse
interface and all other devices.

 

/etc

this is a sort of “miscellaneous” directory which holds all
kind of files related to all kinds of things. Many system configuration
files are here such as teh file which controls the X windows server
and local area network configuration files.

 

/home

contains th home directories of users on the system. That is
the directory a user finds himself in when he logs on, and in which he has full
ownership permissions.

 

/lib

libraries(shared program files) used by programs and the
operating system are in this directory.

 

/mnt

this is a general mounting point. It is a temporary directory can be used as
storage.

 

/opt

This directory contains optional files and packages loaded onto the system.

/proc

this is not a real directory, it is simulated by the
operating system, It shows many pieces of information about the
hardware and software of the system.

/root

This is the home directory of the superuser, “root”.

/sbin

This directory contains system binary files, i.e. executables programs that form
part of the operating system.

 

/tmp

This is a drictory in Linux. This direcoty is avaible to all users and programs. This directory is used for storing temporary files and data.

 

/usr

general directory containing several subdirectories with
source code, executable programs, and whole application directories.

 

/var

this is directory contains variable data like system logs,
print spool files, and lock files.

 

 

How to find a location of any file on Linux system:

the location of any file on Linux system can be represented by
writing first the root symbol, followed by the name of each directory,
representing the sub branch of the tree where the file resides.
These elements are separated by more /symbols.

 

For Example;

/home/john/myfile.txt

This notation is called path. The example represents the file
“myfile.txt in the subdirectory “John”, located in the root
level directory “home”.

Linux filenames can be any length and are case sensitive. They
can also contain spaces, although you may need to enclose the name in quotes (“and “)
when you pass a filesname to a commadn, so that the commadn knows that it is all one name.

This means that “myfile”, “MyFile” and MYFILE are all diffrent
names and may coexist in the same directory.

Leave a Reply

Your email address will not be published. Required fields are marked *