Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Assignment

Topic:- Directory Structure


Course code:- S2021 CST102-81
Under guidance of Professor Gurpreet Kaur
Student ID:- A00127469
Student Name:- Mehakpreet Kaur

P.T.O
There are total 18 sub directories and 1 file in our root
directory.

/media
/opt /
runn

1. Root directory

 Root directory is the ultimate parent directory all the other directories and
subdirectory.
 In the root directory all the other directories are like branches that’s why it is
known as tree like structure.
 Only root user can access to the other sub directories in the root while other
user can only login into their user account under home.
 To show it is at top level, it has given special symbol “/”.
 The sub-directories which are branched off from the root directory are
mentioned above through diagram and screenshot which is discussed in
upcoming parts.
 It is also known as hierarchy system because there is hierarchy of levels of
directories where root directory is at highest level.

2. /bin directory

 Bin stands for binary. This directory contains many basic Linux commands.
 All the files in this directory is executable.
 These files contains the text which only computer can understand, in other
words the files are programmed for the ease of user so that whatever user
wants to perform a particular command then user have to simply type that
command and to make computer understand there is special type of coding is
running behind that command, that all coding is present in this directory with
the name of that command.
 There are more than thousands files in /bin.
Let’s see coding of one file in bin directory :-
Coding in vi passwd

3. /boot directory

 This contains the files required to boot our system.


 There are hidden files in this directories.
 the GRUB boot loader’s files and Linux kernels are stored here which are
hidden.

4. /dev directory
 As in Linux devices are also known as files, so this directory contains
the devices files.
 It contains number of special files which represent devices such as
ttyS104, tty0, etc.
 These are neither normal files nor the directory but they appear as files
even we can’t access to these device files.
 This directory also contain pseudo devices which are virtual devices in
actual that doesn’t represent to hardware such as null, random etc.

5. /etc directory

 This directory contains configuration files which are used to control the
operation of a program.
 Mainly it contains the system-wide configuration files while user
configuration files are in home directory.
 It is also treated as nerve centre of Linux machine.

6. /home directory
 Home directory is similar to our homes where we reside.
 It contains the user’s data files as well as user configuration files are
hidden in above snapshot along with this it have our user account in it
such as mehakpreet_kaur.
 Every user have access to this directory while to access other
directory user require elevated permissions to modify other files.

7. /lib directory

 This directory have essential shared libraries.


 It has also some other directories under root such as lib32, lib64,
libx32.
 It contains all the library files which are used in this file.
 These files are helpful in proper execution of applications, commands
or process.
 This directory contains library files of /bin , /sbin and kernel modules.
 For example, lets look the scripting in sudo directory under library.
8. /media directory

 This directory contains the directories of removable media files.


 As in snapshot it is currently showing only presence of some hidden
files as there is no removable media is inserted in the system.
 It temporarily mounted directories for the removable media devices.
 For example: if we inserted any CD in our Linux system it
automatically create a sub-directory under media directory where we
can access content of CD.

9. /mnt directory

 /mnt directory stands for mount directory.


 This directory is basically used by system administrators where they
mount temporary file system when they require.
 For example :- in this directory the data of local C disk is present
because we are accessing ubuntu through windows.

10. /opt directory

 /opt directory stands for optional directory.


 This directory is designed to contains optional applications or
software
 Mainly these software are proprietary software which kept all their
installed file under this directory.
 These directory is designed because proprietary software doesn,t
follow file hierarchy system.
 Currently in above snapshot it is showing hidden files because
there is not third party software installed under ubuntu.
11. /proc directory

 /proc stands for process. This directory contains the files of process and kernel
process.
 As /dev directory it also contains special files named ad pseudo files that
contains process and system information.
 These files are automatically mounted by the system when required but we
can also manually mount these by using the specific command.
 This directory even contains the information related to our system. For
example :- information related to our C.P.U under stat file, information about
version of linux and windows under stat.

12. /run directory

 /run directory contains the application states files.


 In this directory applications can have a standard place to store
transient files which they need like sockets and process ID’s.
 We can’t store these files to /tmp because in /tmp directories may be
deleted.
13. /sbin directory

 /sbin stands for system binary.


 This directory is similar to bin directory but the only difference is that this
directory contains binary files for system(root) whereas /bin directory have
user binary files.
 It contains the essential binaries which usually used by the root user for
system administration.
 Lets see the scripting of one file under sbin
 This snapshot is scripting of debugfs which is very long scripting from which
some part is taken for example.

14. /snap directory

 In this directory user configuration package snaps are kept.


 This directory presents installed snap packages.
 It provide us command line tools used to install and remove snaps and do
many other things in the snap ecosystem.
15. /srv directory

 /srv stands for service.


 This directory contains data for services provided by the system.
 Currently it show no subdirectories under srv because it is not
connected to any protocol.
 On large systems it can be useful to structure /srv by administrative
context, such as /srv/physics/www; /srv/cvs.

16. /sys directory

 /sys directory is an interface to a kernel.


 It provides a filesystem-like view of information and configuration
settings that the kernel provides, much like /proc.
 This directory contains the files related to information of hardware.
 It also host  diagnostic and debugging related information of various
kernel subsystems.
17. /tmp directory

 /tmp directory stands for temporary directory.


 It contains files which are temporary files which are created by
system and users.
 These files are deleted when the system is restarted.
18. /usr directory

 This directory contains the files and subdirectories used by users.


 It has bin, sbin and lib directories similar to root directory.
 It has non essential applications are under subdirectories of this directory
while all the essential applications are stored under root directory.
 It also have other directories such as share which have architecture-
independent files like graphics.

19. /var directory

 This directory have variable data files.


 This directory is the writable counterpart to the /usr directory which
must be read-only in normal operation.
 This directory contains to which the system writes data during the course
of its operation.
 This directory is specific for each directory as it can’t be shared on
network.

You might also like