0% found this document useful (0 votes)
17 views12 pages

File Systems

Uploaded by

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

File Systems

Uploaded by

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

APIC – Training

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

Linux File System


A file system mainly consists of 3 layers. From top to bottom:

Logical file system


Acts as a layer between user-applications and filesystems.
Responsible for operations like opening, reading and closing
files.

Virtual file system


Responsible for managing use of concurrent operation of
several instances of physical file system.
Provides standardized interface, so that several different file
systems to coexist and operate simultaneously.

Physical file system


Handles low level details of storing and retrieving data,
interacting directly with the hardware components.

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

Different File systems in Linux


1.ext:
Developed in 1992.
First file system developed for linux.

2.ext2:
Developed in the year of 1993
Non journaling file system, preferred to be used with flash disks
and SSD’s.
As it is a non journaling file system, it takes long time to boot.

3.Xiafs:
Also developed in 1993

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

But less powerful and functional than ext2, and is no longer in


use.

4.ext3:
Developed in 1999
It is a journaling file system.
Faster and more reliable than ext2, and doesn’t have boot delay
issues.

5.JFS:
Journaled file system
Orginally developed by IBM in the year of 1990.
Made open-source and adopted to linux in 1999
But is not commonly used after the release of ext4 in 2006.

6.ReieserFS:
Developed in 2001
Has features like B+ trees.
Default filesystem for SUSE Linux 6.4 until the release of ext4 in
2006.

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

7.XFS:
64-bit journaling file system.
Used as default file system for many linux distributions.

8.Ext4
The fourth ext developed in 2006, is a journaling file system. It
has backward compatibility with ext3 and ext2 and it provides
several other features.

9.Reiser4:
Improved version of reiserFS, developed in 2004.
But not widely adopted.

10.Btrfs (b-tree FS):


Developed in 2007.
snapshotting, drive pooling, data scrubbing, self-healing and
online defragmentation. It is the default file system for Fedora
Workstation.

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

Different types of files in the file system


/boot – Contains files related to boot(eg:grub,grub2)
/dev-Contains system device files or device special files that
provides access to peripheral devices.
/tmp- contains temporary files
/usr/bin- contains user binary files, such as commands.
/usr/sbin- contains system binary files.
/etc – Contains system configuration files, similar to program
files in windows.
/opt- contains optional installed application file
/home-home directory of user.
/root- home directory of root user.
/var- contains files of variable length, such as log and print files.
/run-Contains system daemons that start very early.
/proc- contains files about running processes.
/media - for cd-rom mounts
/mnt- contains files for mounting, such as mounting of cd-rom

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

Hard links and soft links

Creating soft links


ln -s /home/<file path>
To check if we created soft links use
ls -ltr

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

Compressing a file
For compressing we use tar and gz commands.
Tar cvf <compresing filename>.tar <file1> <file2>
gzip <compresing filename>.tar

Decompressing a file:
gunzip <compressed file>.tar.gz
tar xvf <compressed file>.tar

Find files and directories:

1.find:

find . -name “<filename>”

here, ‘.’ Specifies in the present directory.

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

find / -name “<filename>”

here, ‘/’ specifies search in the root directory.

Find file owned by a group:

find directory-location -group {group-name} -name {file-


name}

Where,

directory-location : Locate the file in this directory path.

-group {group-name}: Find the file belongs to group-


name.

-name {file-name}: The file name or a search pattern

Sample commands:
find /home -group ftpusers

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

To find all *.c file belongs to a group called “ftpusers” in /data/project directory,
run:
# find /data/project -group ftpusers -name "*.c"

Find all *.mp4 files by group vivek


Run:
$ find $HOME -name "*.mp4" -group vivek

Find file owned by user name:


find directory-location -user {username} -name {file-
name}

Remove all the files in the directory :


To remove all non-hidden files* in a directory use:
rm /path/to/directory/*
To remove all non-hidden files and sub-directories (along with all of
their contents) in a directory use:

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081
APIC – Training

rm -r /path/to/directory/*

Remove all the files in the directory which have an


extension:
rm /path/to/directory/*.*

4th Floor, R R Plaza, #1-48/243, Plot No.243, Kavuri Hills, Madhapur, Hyderabad, Telangana – 500081

You might also like