We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
UNIX/LINUX
drwxr-xr-x 102 durgasoft durgasoft 4096 Nov 17 21:19 magic
-rw-r-r- 1 durgasoft durgasoft 0 Nov 17 21:24 sunny. txt
‘The first character represents the type of file.
> Directory File
= Normal File
1 Link File
> Character Special File
b > Block Special File
5 > Socket File
Note: c, b, s are representing system files and mostly used by super user (also known as
root user or admin user)
le System Navigation Commands:
1) Every directory implicitly contains 2 directories . and ..
- Represents Current Directory
.. Represents Parent Directory
Sed.
Changes to Current Directory (Useless)
$ed..
Changes to Parent Directory
$ed
If we are not passing any argument, then changes to user home directory.
$ed~
~ Means User Home Directory.
It will Changes to User Home Directory.
$ed-
- Means Previous Working Directory.
It will Changes to Previous Working Directory.
durgasoft@durgasoft:~/Downloads/coreutils-8.31/src$ pwd
/home/durgasoft/Downloads/coreutils-8.31/src
durgasoft@durgasoft :~/Downloads/coreutils-8.31/src$ cd ~
durgasoft@durgasoft:~$ pwd
7home/durgasoft
durgasoft@durgasoft:~$ cd -
/home/durgasoft/Downloads/coreutils-8.31/src
durgasoft@durgasoft :~/Downloads/coreutilsUNIX/LINUX
/home/durgasoft/Downloads/coreutils-8.31/src
durgasoft@durgasoft :~/Downloads/coreutils-8.31/src$ cd ../../..
durgasoft@durgasoft:~$ pwd
/home/durgasoft
Linux File System Hierarch
Linux file system has Tree Like Structure.
It starts with root(/).
/is the topmost directory
This root directory contains the following important sub directories.
bin sbin lib,ete,dev,opt,home,usr,tmp,media ete
bin means binary. This directory contains all binary executables related to our linux
commands.
2) sbin Directory:
sbin means systembin. It contains all binary executables related to high end admin
(super user OR root) commands.
Eg; Disk partitioning, network management etc
Q1) What is the difference between bin and sbin?
bin contains binary executables related to commands used by normal user.
sbin contains binary executables related to commands used by superuser.
DURGASOFT, # 202, 2” Floor, HUDA Maitrivanam, Ameerpet, Hyderabad - 500038,
83 85 25 26 27, 72.07 21 24 27/28 | www.durgasottonline.com
[email protected]3) etc Directory:
This directory contains all system configuration files. These configural
to customize behaviour of linux os.
All users information available in /etc/passwd file.
All groups information available in /ete/group
Hosts information (ip address and dns names) available in /etc/hosts file.
4) tmp Directory:
tmp means temporary. It contains all temporary files created in the current session.
If any file is required only for the current session, then create that file inside tmp
directory. These files will be deleted automatically at the time of system shutdown,
If any file which is required permanently, then it is not recommended to create inside
dev means device.
In Linux, everything is treated as a file including devices also. i.e every device is
represented as a file. By using these files, we can communicate with the devices.
All device related files will be stored inside dev directory.
tty > Terminal related File
isk related File
ram > RAM related File
stdin -> standard Input Device File (keyboard)
stdout > Standard Output Device File (Terminal/Monitor)
stderr > Standard Error Device File (Terminal/Monitor)
6) mnt Directory:
‘mnt means mounting.
We have to attach external file system files from Pen drive, CD, external hard disk etc
to the Linux File System. Then only we can use those external files. This attachment
process is called mounting.
In the old operating systems, we have to perform mounting manually. But in recent
operating systems, mounting is performing automatically and we are not required to
perform manually.
The files of manual mounting will be placed inside mnt directory.
7) media Directory:
The files of automatic mounting will be placed inside media directory.
500038,
88 85 25 26 27, 72 07 21 24 27/28 | www.duraasoftonline,com
‘Mali: [email protected]Q2) What is the difference between mnt and media?
mnt > Contains manual mounting files.
media > Contains automatic mounting files.
8) opt Directory:
+ opt means optional.
‘+ This directory contains all 3rd party software installation files.
5
If we are installing any software explicitly like google chrome, then the corresponding
installation files will be stored inside opt directory.
9) lib Directory:
lib means library. It contains Linux os libraries which are required by our commands
and applications.
10) var Directory:
‘+ var means variable data. If any data which is keep on changing, such type of data will
be stored inside var directory.
‘+ log files will be stored inside var.
11) home Directory:
As linux is multi user operating system, for every user a separate directory will be
created to hold his specific data like videos, images, documents etc. All these user
directories will be stored inside home directory.
$s home
demo demo1 demo2 durga durga1 durga2 durgaS durgasoft
Note:
/home/durgasoft > Is called durgasoft user home directory. It contains multiple sub
directories like Desktop, Downloads, Movies, Pictures etc.
12) proc Directory:
* proc means processes.
‘+ In Linux, multiple processes are running simultaneously. For every process a unique id
will be there, which is also known as PID (Process ID}.
‘+ The data related to current running processes will be stored inside proc directory. For
every process a separate directory will be created inside proc to maintain that
data.The name od this directory is same as PID.
ivanam, Ameerpet, Hyder
7/28 | wwew.durgasoftonline.com
[email protected]Note: We can find all running proceses information by using ps command.
Ps means process status.
durgasoft@durgasoft:/$ ps -eF
i) PID PPID C STIME TTY TIME CMD
root 1 0 5? :08:03 /sbin/init
root 2 @ ? 00:08 [kthreadd]
root 32 00:00 [rcu_gp]
root 4 2 08:00 [rcu_par_g
13) root Directory:
It is the home directory of super user.
Not
/home/durgasoft > Durgasoft User Home Directory
/root > Super User Home Directory
Q3) What is the difference between / and Root Directories?
/ acts as root for Linux file system. It is the topmost directory of linux file system.
root is subdirectory of /, which acts as home directory for the super user.
14) boot Directory:
This directory contains the files which are required to boot linux os.
15) usr Directory:
usr means user. This directory contains all user related softwares.
Note:
1) The main advantage of Linux File System is, operating system can locate required files
very easily.
2) For every File System, a separate name will be assigned.
3) ext2,ext3,ext4,XFS are names of Linux File Systems.
4) NTFS, FAT are names of Windows File Systems.
ivanam, Ameerpet, Hyder
7/28 | wwew.durgasoftonline.com
[email protected]