Presented By Presented By :- Miss. Sonal :- Miss. Sonal Sabhaya Sabhaya & & Miss. Hetal Miss. Hetal Dobariya Dobariya (FY.M.Sc(IT&CA)) (FY.M.Sc(IT&CA)) Submitted TO Submitted TO :- :- Miss. Rachana Miss. Rachana Kamalia Kamalia
May 25, 2015
Presented By Presented By :- Miss. Sonal Sabhaya:- Miss. Sonal Sabhaya&&
Miss. Hetal DobariyaMiss. Hetal Dobariya
(FY.M.Sc(IT&CA))(FY.M.Sc(IT&CA))
Submitted TO Submitted TO :- :-
Miss. Rachana KamaliaMiss. Rachana Kamalia
Index
IntroductionFile System Hierarchy StandardTypes of fileAcces Mode of files and directoryChanging PermissionNavigation 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
Filesystem Hierarchy Filesystem Hierarchy StandardStandard
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
Linux File System
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.
Directory Access Modes
Linux File System
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.
Interpreting the Mode
Linux File System
Changing Permission
Linux File System
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
Changing Permission
Linux File System
Navigating the File System
Linux File System
• Pwd (Present Working Directory)
• cd
• ls
Using the pwd Command
Linux File System
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 pwd [OPTION]...
Using the pwd Command
Linux File System
-P, --physicalPrint the Physical Directory Path Without any Sysmbolic Link.
--help Display a help message.
--version Display version information.
Using the pwd Command
Linux File System
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: $ pwd /usr/local/bin $ cd .. $ pwd /usr/local
Using the cd Command
Linux File System
The Linux cd command stands for change directory. It is the primary command for moving between directories on a
Unix/Linux filesystem. Syntex: cd [directory]
Here directory is the name of the directory where you wish to go.
.
Examples of cd command
Linux File System
Change working directory to /abc/xyzpwd
/home/ITcd /abc/xyz
pwd/abc/xyz
Change working directory to user’s home directorypwd/etc/BCA
cd ~orcdpwd
/home/IT Change working directory to parent directory.
cd ..
Examples of cd command
Linux File System
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
Pushd command
Linux File System
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
Using the ls Command
Linux File System
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
Using the ls Command
Linux File System
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
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
Linux File System
l
# ls -a
. .bashrc Documents .gconfd install .log .nautilus .pulse-cookie .. .cache Downloads .gnome2 install .log.syslog .netstat.swp .recently-used.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 cdrom dev
//Display One File Per Line Using ls -1
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
Linux File System
l# 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
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