PPrreesseenntteedd BByy ::-- MMiissss.. SSoonnaall SSaabbhhaayyaa 
&& 
MMiissss.. HHeettaall DDoobbaarriiyyaa 
((FFYY..MM..SScc((IITT&&CCAA)))) 
SSuubbmmiitttteedd TTOO ::-- 
MMiissss.. RRaacchhaannaa KKaammaalliiaa
Index 
Introduction 
File System Hierarchy Standard 
Types of file 
Acces Mode of files and directory 
Changing Permission 
Navigation Command 
Linux File System
Introduction 
All data in Linux organized into files. 
All files are organized into directories. 
These directories are organized into a tree-like 
structure called the file system. 
Linux file system also enables you to group files 
into directories, which is similar to folder you 
create in windows explorer 
Linux File System
FFiilleessyysstteemm HHiieerraarrcchhyy SSttaannddaarrdd 
 Defines the main directories and their contents in most 
Linux-based systems 
 There is not any drive C:, D:, … 
 All directories are under “/” 
 “/” is the root directory 
 It is possible 
 to have multiple partitions 
 to multiple filesystems 
Linux File System
Filesystem Hierarchy Standard 
(continued)… 
Linux File System
cont…. 
Linux File System
cont…. 
Linux File System
Types of file 
-> Ordinary Files: 
An ordinary file is a file on the system that contains data, text, or 
program instructions. 
-> Directories: 
Directories store both special and ordinary files. For users 
familiar with Windows or Mac OS, UNIX directories are equivalent 
to folders. 
Linux File System
Types of file 
-> Special Files: 
Some special files provide access to hardware such as hard 
drives, CD-ROM drives, modems, and Ethernet adapters. Other 
special files are similar to aliases or shortcuts and enable you to 
access a single file using different names. 
Linux File System
File Access Mode 
Read: 
 Grants the capability to read ie. view the contents of the file. 
Write: 
 Grants the capability to modify, or remove the content of the file. 
Execute: 
 User with execute permissions can run a file as a program. 
Linux File System
Directory Access Modes 
Read: 
Access to a directory means that the user can read the 
contents. The user can look at the filenames inside the 
directory. 
Write: 
Access means that the user can add or delete files to the 
contents of the directory. 
Execute: 
A user must have execute access to the bin directory in 
order to execute ls or cd command. 
Linux File System
Interpreting the Mode 
Linux File System
Changing Permission 
 chmod (change mode) command: Change mode (permissions) of files or 
directories. 
 Permissions stored in a file’s. 
 New files given rw-rw-rw- permissions by default 
Linux File System
Changing Permission 
Linux File System
Navigating the File System 
• Pwd (Present Working Directory) 
• cd 
• ls 
Linux File System
Using the pwd Command 
 pwd stands for Print Working Directory. 
 pwd is a Linux / Unix command which prints the current working 
directory. 
 pwd prints the full pathname of the current working directory. 
Syntax 
Linux File System 
pwd [OPTION]...
Using the pwd Command 
-P, --physical Print the Physical Directory Path Without any Sysmbolic 
Linux File System 
Link. 
--help Display a help message. 
--version Display version information.
Using the pwd Command 
Examples: 
$ pwd 
/home/IT 
and the computer prints out /home/IT, that means that the directory the 
user is currently in is /home/IT. 
In the following example, the user is located in the directory 
/usr/local/bin, uses the command pwd, uses the command cd .. to move 
back to the parent directory and then uses pwd again: 
Example: 
Linux File System 
$ pwd 
/usr/local/bin 
$ cd .. 
$ pwd 
/usr/local
Using the cd Command 
 The Linux cd command stands for change directory. 
 It is the primary command for moving between directories on a 
Unix/Linux filesystem. 
 Syntex: 
Linux File System 
cd [directory] 
 Here directory is the name of the directory where you wish to go. 
.
Examples of cd command 
 Change working directory to /abc/xyz 
pwd 
/home/IT 
cd /abc/xyz 
pwd 
/abc/xyz 
 Change working directory to user’s home directory 
pwd 
/etc/BCA 
cd ~ 
or 
cd 
pwd 
/home/IT 
 Change working directory to parent directory. 
cd .. 
Linux File System
Examples of cd command 
 Change working directory to parents parent directory or two levels up in 
the directory structure. 
cd ../.. 
 Using wildcards 
cd /v* 
The * wildcard characters can be interpreted as "any number of 
any character", so the Linux system expands the /v* that typed into 
/var 
 Change the working directory to /var/ftp without mentioning ftp fully. 
cd /var/ft? 
This will change the directory to /var/ftp 
Linux File System
Pushd command 
 Use pushd command to change the directory. This is similar 
to cd command. 
 It saves the current working in memory . 
Ex. pushd /var/ftp/pub 
Linux File System
Using the ls Command 
 ls is a Linux shell command that lists directory contents and 
Files. 
 ls syntax 
$ ls [options] [file|dir] 
# ls 
0001.Pcap Desktop Downloads index.html install.log.syslog Pictures 
Templates anaconda-ks.cfg Documents fbcmd_update.php install.log 
Music Public Videos 
Linux File System
Using the ls Command 
ls -a list all files including hidden file starting with '.' 
ls -d list directories - with ' */' 
ls -F It differenciate files and directory. 
ls -i list file's inode index number 
ls -l list with long format - show permissions 
ls -la list long format including hidden files 
ls -lh list long format with readable file size 
Linux File System
Using the ls Command 
Linux File System 
l 
ls -ls list with long format with file size 
ls -r list in reverse order 
ls -R list recursively directory tree 
ls -s list file size 
ls -S sort by file size 
ls -t sort by time & date 
ls -X sort by extension name
Using the ls Command 
# ls -a 
. .bashrc Documents .gconfd install .log .nautilus .pulse-cookie .. 
.cache Downloads .gnome2 install .log.syslog .netstat.swp .recently-used. 
Linux File System 
l 
xbel 0001 .pcap .config .elinks 
# ls -F 
0001.Pcap Desktop/ Downloads/ index.html install.log.syslog 
Pictures/ Templates/ anaconda-ks.cfg Documents/ fbcmd_update.php 
install.log Music/ 
$ ls -1 
bin 
boot 
//Display One File Per Line Using ls -1 
cdrom 
dev
Using the ls Command 
Linux File System 
l 
$ ls / /*List root directory*/ 
$ ls .. List /*parent directory*/ 
$ ls ~ /*List user's home directory*/ 
$ ls * /*List all subdirectories*/ 
$ ls *.txt /*List only text files with wildcard*/ 
$ ls > out.txt /*ls redirection to output file*/
Using the ls Command 
# ls -lS 
total 176 
-rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log 
-rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html 
-rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php 
-rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents 
drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates 
drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos 
-rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg 
-rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap 
Linux File System 
l
Using the ls Command 
Linux File System 
l 
# ls -i 
20112 0001.pcap 23610 Documents 23793 index.html 23611 Music 
23597 Templates 23564 anaconda-ks.cfg 23595 Downloads 22 install.log 
23612 Pictures 23613 Videos 23594 Desktop 23585 fbcmd_update.php 
35 install.log.syslog
That’s All About Linux File 
System Navigation 
Linux File System 
l
Thank You 
Linux File System 
l

Linux file system nevigation

  • 1.
    PPrreesseenntteedd BByy ::--MMiissss.. SSoonnaall SSaabbhhaayyaa && MMiissss.. HHeettaall DDoobbaarriiyyaa ((FFYY..MM..SScc((IITT&&CCAA)))) SSuubbmmiitttteedd TTOO ::-- MMiissss.. RRaacchhaannaa KKaammaalliiaa
  • 2.
    Index Introduction FileSystem Hierarchy Standard Types of file Acces Mode of files and directory Changing Permission Navigation Command Linux File System
  • 3.
    Introduction All datain Linux organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the file system. Linux file system also enables you to group files into directories, which is similar to folder you create in windows explorer Linux File System
  • 4.
    FFiilleessyysstteemm HHiieerraarrcchhyy SSttaannddaarrdd  Defines the main directories and their contents in most Linux-based systems  There is not any drive C:, D:, …  All directories are under “/”  “/” is the root directory  It is possible  to have multiple partitions  to multiple filesystems Linux File System
  • 6.
    Filesystem Hierarchy Standard (continued)… Linux File System
  • 7.
  • 8.
  • 9.
    Types of file -> Ordinary Files: An ordinary file is a file on the system that contains data, text, or program instructions. -> Directories: Directories store both special and ordinary files. For users familiar with Windows or Mac OS, UNIX directories are equivalent to folders. Linux File System
  • 10.
    Types of file -> Special Files: Some special files provide access to hardware such as hard drives, CD-ROM drives, modems, and Ethernet adapters. Other special files are similar to aliases or shortcuts and enable you to access a single file using different names. Linux File System
  • 11.
    File Access Mode Read:  Grants the capability to read ie. view the contents of the file. Write:  Grants the capability to modify, or remove the content of the file. Execute:  User with execute permissions can run a file as a program. Linux File System
  • 12.
    Directory Access Modes Read: Access to a directory means that the user can read the contents. The user can look at the filenames inside the directory. Write: Access means that the user can add or delete files to the contents of the directory. Execute: A user must have execute access to the bin directory in order to execute ls or cd command. Linux File System
  • 13.
    Interpreting the Mode Linux File System
  • 14.
    Changing Permission chmod (change mode) command: Change mode (permissions) of files or directories.  Permissions stored in a file’s.  New files given rw-rw-rw- permissions by default Linux File System
  • 15.
  • 16.
    Navigating the FileSystem • Pwd (Present Working Directory) • cd • ls Linux File System
  • 17.
    Using the pwdCommand  pwd stands for Print Working Directory.  pwd is a Linux / Unix command which prints the current working directory.  pwd prints the full pathname of the current working directory. Syntax Linux File System pwd [OPTION]...
  • 18.
    Using the pwdCommand -P, --physical Print the Physical Directory Path Without any Sysmbolic Linux File System Link. --help Display a help message. --version Display version information.
  • 19.
    Using the pwdCommand Examples: $ pwd /home/IT and the computer prints out /home/IT, that means that the directory the user is currently in is /home/IT. In the following example, the user is located in the directory /usr/local/bin, uses the command pwd, uses the command cd .. to move back to the parent directory and then uses pwd again: Example: Linux File System $ pwd /usr/local/bin $ cd .. $ pwd /usr/local
  • 20.
    Using the cdCommand  The Linux cd command stands for change directory.  It is the primary command for moving between directories on a Unix/Linux filesystem.  Syntex: Linux File System cd [directory]  Here directory is the name of the directory where you wish to go. .
  • 21.
    Examples of cdcommand  Change working directory to /abc/xyz pwd /home/IT cd /abc/xyz pwd /abc/xyz  Change working directory to user’s home directory pwd /etc/BCA cd ~ or cd pwd /home/IT  Change working directory to parent directory. cd .. Linux File System
  • 22.
    Examples of cdcommand  Change working directory to parents parent directory or two levels up in the directory structure. cd ../..  Using wildcards cd /v* The * wildcard characters can be interpreted as "any number of any character", so the Linux system expands the /v* that typed into /var  Change the working directory to /var/ftp without mentioning ftp fully. cd /var/ft? This will change the directory to /var/ftp Linux File System
  • 23.
    Pushd command Use pushd command to change the directory. This is similar to cd command.  It saves the current working in memory . Ex. pushd /var/ftp/pub Linux File System
  • 24.
    Using the lsCommand  ls is a Linux shell command that lists directory contents and Files.  ls syntax $ ls [options] [file|dir] # ls 0001.Pcap Desktop Downloads index.html install.log.syslog Pictures Templates anaconda-ks.cfg Documents fbcmd_update.php install.log Music Public Videos Linux File System
  • 25.
    Using the lsCommand ls -a list all files including hidden file starting with '.' ls -d list directories - with ' */' ls -F It differenciate files and directory. ls -i list file's inode index number ls -l list with long format - show permissions ls -la list long format including hidden files ls -lh list long format with readable file size Linux File System
  • 26.
    Using the lsCommand Linux File System l ls -ls list with long format with file size ls -r list in reverse order ls -R list recursively directory tree ls -s list file size ls -S sort by file size ls -t sort by time & date ls -X sort by extension name
  • 27.
    Using the lsCommand # ls -a . .bashrc Documents .gconfd install .log .nautilus .pulse-cookie .. .cache Downloads .gnome2 install .log.syslog .netstat.swp .recently-used. Linux File System l xbel 0001 .pcap .config .elinks # ls -F 0001.Pcap Desktop/ Downloads/ index.html install.log.syslog Pictures/ Templates/ anaconda-ks.cfg Documents/ fbcmd_update.php install.log Music/ $ ls -1 bin boot //Display One File Per Line Using ls -1 cdrom dev
  • 28.
    Using the lsCommand Linux File System l $ ls / /*List root directory*/ $ ls .. List /*parent directory*/ $ ls ~ /*List user's home directory*/ $ ls * /*List all subdirectories*/ $ ls *.txt /*List only text files with wildcard*/ $ ls > out.txt /*ls redirection to output file*/
  • 29.
    Using the lsCommand # ls -lS total 176 -rw-r--r--. 1 root root 48867 Jul 31 02:17 install.log -rw-r--r--. 1 root root 46701 Jul 31 09:58 index.html -rw-r--r--. 1 root root 21262 Aug 12 12:42 fbcmd_update.php -rw-r--r--. 1 root root 11439 Jul 31 02:13 install.log.syslog drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Desktop drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Documents drwxr-xr-x. 4 root root 4096 Aug 16 02:55 Downloads drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Music drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Pictures drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Public drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Templates drwxr-xr-x. 2 root root 4096 Jul 31 02:48 Videos -rw-------. 1 root root 1586 Jul 31 02:17 anaconda-ks.cfg -rw-r--r--. 1 root root 683 Aug 19 09:59 0001.pcap Linux File System l
  • 30.
    Using the lsCommand Linux File System l # ls -i 20112 0001.pcap 23610 Documents 23793 index.html 23611 Music 23597 Templates 23564 anaconda-ks.cfg 23595 Downloads 22 install.log 23612 Pictures 23613 Videos 23594 Desktop 23585 fbcmd_update.php 35 install.log.syslog
  • 31.
    That’s All AboutLinux File System Navigation Linux File System l
  • 32.
    Thank You LinuxFile System l