0% found this document useful (0 votes)
38 views25 pages

Linux File System

Uploaded by

Aviral gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views25 pages

Linux File System

Uploaded by

Aviral gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

LINUX FILE SYSTEM

Linux file system


Directories
 bin—Contains common Linux user commands,
such as ls, sort, date, and chmod.
 boot—Has the bootable Linux kernel and boot
loader configuration files (GRUB).
 dev—Contains files representing access points
to devices on your systems.
 etc—Contains administrative configuration files.
Directories
 home—Contains directories assigned to each
regular user with a login account.
 media—Provides a standard location for
automounting devices
 lib—Contains shared libraries needed by
applications in /bin and /sbin to boot the
system.
Directories

misc—A directory sometimes used to automount
filesystems upon request.

/opt—Directory structure available to store add-
on application software.

proc—Contains information about system
resources.

root—Represents the root user’s home directory.
The home directory for root does not reside
beneath /home for security reasons.
Directories
 sbin—Contains administrative commands and
daemon processes.
 tmp—Contains temporary files used by
applications.
 /usr—Contains user documentation, games,
graphical files (X11), libraries (lib),and a variety
of other commands and files that are not needed
during the boot process. The /usr directory is
meant for files that don’t change after installation

var—Contains directories of data used by various
applications. In particular, this is where you would
place files that you share as an FTP server (/var/ftp)
or a web server (/var/www). It also contains all
system log files (/var/log) and spool files in /var/spool
(such as mail, cups, and news). The /var directory
contains directories and files that are meant to
change often. On server computers, it is common to
create the /var directory as a separate filesystem,
using a filesystemtype that can be easily expanded.
Comparision between winows and
linux
 C:\home\joe  /home/joe
 Filenames almost  Not necessary
always have suffixes  File permissions decide
in DOS the executable
 .exe  Every file and directory
 Windows was in a Linux system has
permissions and
developed for single
ownership associated
user. with it.
Comparision between winows and
linux
 In MS-DOS and  In Linux, all storage
Windows filesystems, devices are connected
drive letters represent to the filesystem
different storage hierarchy. So the fact
devices (for example, that all of /usr may be
A: is a floppy drive on a separate hard disk
or that /mnt/remote1 is
and C: is a hard disk).
a fi lesystem from
another computer is
invisible to the user.
Commands to create use files
Commands and outputs
 $ cd /usr/share/
 $ pwd
 /usr/share

 $ cd doc
 /usr/share/doc

 $ cd
 $ pwd
 /home/chris
Commands
 $ cd ~
 $ pwd
 /home/chris

 $ cd ~/Music$ pwd
 /home/chris/Music

 $ cd ../../../usr
 $ pwd
 /usr
TASK
 Go to your home directory.
 make sure that you’re in your home directory
 Create a new directory called test in your home
directory
 Check the permissions of the directory
 Make the test directory your current directory
Change the permission of test
directory
 $ chmod 700 test
Using Metacharacters and
Operators
■ *—Matches any number of characters.
■ ?—Matches any one character.
■ [...]—Matches any one of the characters
between the brackets, which can include a
hyphen-separated range of letters or numbers.
Using Metacharacters and
Operators
 $ touch apple banana grape grapefruit
watermelon
 $ ls a*
 apple

 $ ls g*
 grape grapefruit

 $ ls g*t
 Grapefruit
Using Metacharacters and
Operators
 $ ls *e*
 apple grape grapefruit watermelon

 $ ls *n*
 banana watermelon
Using Metacharacters and
Operators
 $ ls ????e
 apple grape

 $ ls g???e*
 grape grapefruit
Using Metacharacters and
Operators
 $ ls [abw]*
 apple banana watermelon

 $ ls [agw]*[ne]
 apple grape watermelon
Using Metacharacters and
Operators
 $ ls [a-g]*
 apple banana grape grapefruit
QUESTION1
 Create a directory in your home directory called
projects. In the projects directory, create nine
empty files that are named house1, house2,
house3, and so on to house9. Assuming there
are lots of other files in that directory, come up
with a single argument to ls that would list just
those nine files.
QUESTION2
 Make the $HOME/projects/houses/doors/
directory path. Create the following empty files
within this directory path (try using absolute and
relative paths from your home directory):
 $HOME/projects/houses/bungalow.txt
 $HOME/projects/houses/doors/bifold.txt
 $HOME/projects/outdoors/vegetation/
landscape.txt
Question 3
 Copy the fi les house1 and house5 to the
$HOME/projects/houses/ directory.
chmod(letters)

u->users

g->group

o->others

+->allow permission

-->remove permission

r->read

w->write

x->execute
This work is licensed under a Creative Commons
Attribution-ShareAlike 3.0 Unported License.
It makes use of the works of Mateus Machado Luna.

You might also like