SlideShare a Scribd company logo
Chapter three 
Managing Files and Directories 
Prepare by zkre S Saleh 
This chapter explores the general format of your Red Hat Enterprise 
Linux system. It bridges the differences between using Nautilus to 
manage the files on your system and using a shell prompt to manage 
them. It does not go into the minute details of using a shell prompt; 
those will be covered in Chapter 4 Shell Prompt Basics. This chapter 
orients you to the system as a whole, and then you can choose which 
method of management you prefer.
File System Terms 
 extension 
An extension is that part of a filename that is found after the final ".". In the 
filename foo.txt ".txt" is the le's extension. Extensions are used to indicate le 
type. 
 path 
A path is the string of directories and sub-directories you would have to navigate 
through in order to reach a given location in the le system.
File System Terms 
 root access 
To have root access means to be logged in using the root account. This can be 
done from the main login screen, a shell prompt, or any application that requires 
your root password. Root access means that the user has permission to do 
anything on the system, so use root access with care. 
 root directory 
The root directory is the top-most directory of the le system. All other les and 
directories exist in this directory or one of its sub-directories. Do not confuse the 
root directory, /, with root's home directory, /root/.
A Larger Picture of the File System 
 Every operating system has a method of storing data in files and directories so 
that it can keep track 
 of additions, modifications, and other changes. In Red Hat Enterprise Linux, 
every file is stored in 
 a directory. Directories can also contain directories: these subdirectories may 
also contain files and 
 other subdirectories. You might think of the le system as a tree and 
directories as branches. 
 away the directories branch, everything is connected to the root directory, 
which is represented as a 
 singe forward slash (/).
Paths 
/home/user/
Managing Files 
 File Types 
 Naming Conventions 
 Finding the Correct File Extension
Managing Files 
 File Types
Managing Files 
 File Types 
Compressed and Archived Files 
.bz2. a file compressed with bzip2 
.gz. a file compressed with gzip 
. .tar. a file archived with tar (short for tape 
archive), also known as a tar file 
. .tbz or .tar.bz. a tarred and bzipped le 
. .tgz or .tar.gz. a tarred and gzipped le 
. .zip.a le compressed with ZIP compression, 
commonly found in MS-DOS applications; most 
compressed les for Linux use the gzip 
compression, so nding a .zip archive for Linux 
les is 
rare
Managing Files 
 File Types 
File Formats 
.au. an audio le 
.gif. a GIF image le (short for Graphics Interchange 
Format) 
.html or .htm. an HTML le (short for Hyper Text 
Markup Language) 
.jpg. a JPEG image le (short for Joint Photographic 
Experts Group) 
.pdf. an electronic image of a document; PDF stands for 
Portable Document Format 
.png. a PNG image le (short for Portable Network 
Graphic) 
.ps. a PostScript file; formatted for printing 
.txt. a plain ASCII text file 
.wav. an audio le 
.xpm. an image le (short for X Pixelmap)
Managing Files 
 File Types 
 Programming and Scripting Files 
.c . a C program language source code le 
.cpp . a C++ program language source 
code le 
.h . a C or C++ program language header le 
.o . a program object le 
.pl . a Perl script 
.py. a Python script 
.so . a library file 
.sh. a shell script 
.tcl . a TCL script
Managing Files 
 File Types 
 Naming Conventions 
 Finding the Correct File Extension
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File Names 
 Files with Multiple Extensions
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File Names 
 Files with Multiple Extensions
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File Names 
 Files with Multiple Extensions 
Files whose name begins with a ".", called "dot" files, are 
hidden files. These files can be viewed in both graphical file 
managers like Nautilus and from the shell prompt, but require 
an extra step to reveal them. command ls –al used for view 
the hidden files in your home directory, 
How to make hidden file or 
folder ? 
Touch .extension 
Mkdir .extension
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File Names 
 Files with Multiple Extensions 
While Linux allows file names with spaces in them, 
manipulating these files from a shell prompt can be 
quite cumbersome.
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File 
Names 
 Files with Multiple Extensions 
It is possible to use punctuation marks in your file 
names. However, be aware that these special characters 
have special meaning to the shell and may cause errors 
at a shell prompt. It is generally recommended that you 
avoid using special characters in file names for this 
reason. If you choose to use file names with special 
characters, use quotes around the file names when 
manipulating them from a shell prompt. 
You cannot use a "/" — this indicates a directory.
Managing Files 
 Naming Conventions 
 Dot Files 
 Using Spaces in File Names 
 Using Symbols in File 
Names 
 Files with Multiple Extensions
File Compression and Archiving 
File Compression and Archiving 
It is useful to store a group of files in one file for easy backup, for 
transfer to another directory, or for transfer to another computer. It 
is also useful to compress large files; compressed files take up less 
disk space and download faster via the Internet. 
It is important to understand the distinction between an archive file 
and a compressed file. An archive file is a collection of files and 
directories stored in one file. The archive file is not compressed — 
it uses the same amount of disk space as all the individual files and 
directories combined. A compressed file is a collection of files and 
directories that are stored in one file and stored in a way that uses 
less disk space than all the individual files and directories 
combined. If disk space is a concern, compress rarely-used files, or 
place all such files in a single archive file and compress it.
File Compression and Archiving with 
GUI 
 Applications >> accessories >> archive manager
File Compression and Archiving 
 Shell prompt 
Compression Tool File 
Extension 
Decompression Tool 
bzip2 .bz2 bunzip2 
gzip .gz Gunzip 
zip .zip Unzip
File Compression and Archiving 
 Shell prompt 
Bzip2 and Bunzip2 
bzip2 filename. extinction 
bunzip2 filename.ext.bz2
File Compression and Archiving 
 Shell prompt 
gzip2 and gunzip2 
Gzip filename. extinction 
Gunzip filename.ext.gz
File Compression and Archiving 
 Shell prompt 
Zip unzip 
To compress a file with zip, enter the following command: zip -r 
filename.zip filesdir 
The -r option specifies that you want to include all files 
contained in the filesdir directory recursively. 
Zip –r filename.zip collection items 
Zip –r z.zip a b s q.png
File Compression and Archiving 
 Tar 
Tar –cvf coll.tar 1 2 3 4 5 6 dirA dirB dirC 
Filename for 
archiving
File Compression and Archiving 
List Content of tar Archive File 
Tar –tvf coll.tar 
Add Files or Directories to tar Archive File 
Tar –rvf coll.tar 1 2 3 4 5 6 
Check the Size of the tar, tar.gz and tar.bz2 Archive File 
Tar –czf – coll.tar | wc -c
File Compression and Archiving 
 Tar 
Compression and Archiving 
z.Tar >>>> z.tar.gz 
Gzip z.tar
Managing Files and Directories 
 Creating Directories 
 Deleting Directories 
 Dot Directories . 
 
Right-click on Desktop 
select Create Folder 
Change name with you want 
To create a new directory using a shell prompt, use the 
command mkdir. Enter: mkdir
Managing Files and Directories 
 Creating Directories 
 Deleting Directories 
 Dot Directories . 
 
right click on it and choose Move to Trash, or click and drag 
the icon to the Trash on the Desktop. 
To delete an empty directory from a shell prompt, enter the 
command rmdir. 
To delete a directory that may not be empty (and consequently 
everything inside that directory), enter the command rm - rf 
<directory>.
Managing Files and Directories 
 Creating Directories 
 Deleting Directories 
 Dot Directories 
 
Mkdir .name
Thank you for watched

More Related Content

What's hot

Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
Subashini Pandiarajan
 
Virtual Private Networks (VPN) ppt
Virtual Private Networks (VPN) pptVirtual Private Networks (VPN) ppt
Virtual Private Networks (VPN) ppt
OECLIB Odisha Electronics Control Library
 
part2.pdf
part2.pdfpart2.pdf
File System FAT And NTFS
File System FAT And NTFSFile System FAT And NTFS
File System FAT And NTFS
Inocentshuja Ahmad
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
Rakesh Kadu
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
Taaanu01
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mounting
rajshreemuthiah
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
Damian T. Gordon
 
Linux security
Linux securityLinux security
Linux security
trilokchandra prakash
 
Server operating system
Server operating systemServer operating system
Server operating system
Tapan Khilar
 
Computer Networks Lecture Notes
Computer Networks Lecture NotesComputer Networks Lecture Notes
Computer Networks Lecture Notes
FellowBuddy.com
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
Artefactual Systems - AtoM
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - Overview
Ashita Agrawal
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
File system
File systemFile system
File system
Harleen Johal
 
Chapter03 Creating And Managing User Accounts
Chapter03      Creating And  Managing  User  AccountsChapter03      Creating And  Managing  User  Accounts
Chapter03 Creating And Managing User AccountsRaja Waseem Akhtar
 

What's hot (20)

Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Virtual Private Networks (VPN) ppt
Virtual Private Networks (VPN) pptVirtual Private Networks (VPN) ppt
Virtual Private Networks (VPN) ppt
 
part2.pdf
part2.pdfpart2.pdf
part2.pdf
 
File System FAT And NTFS
File System FAT And NTFSFile System FAT And NTFS
File System FAT And NTFS
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
directory structure and file system mounting
directory structure and file system mountingdirectory structure and file system mounting
directory structure and file system mounting
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Linux security
Linux securityLinux security
Linux security
 
Server operating system
Server operating systemServer operating system
Server operating system
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Memory management
Memory managementMemory management
Memory management
 
Computer Networks Lecture Notes
Computer Networks Lecture NotesComputer Networks Lecture Notes
Computer Networks Lecture Notes
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
 
Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - Overview
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
File system
File systemFile system
File system
 
Chapter03 Creating And Managing User Accounts
Chapter03      Creating And  Managing  User  AccountsChapter03      Creating And  Managing  User  Accounts
Chapter03 Creating And Managing User Accounts
 

Viewers also liked

Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 
File management ppt
File management pptFile management ppt
File management pptmarotti
 
File management
File managementFile management
File management
Vishal Singh
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
Damian T. Gordon
 
Unix and Linux
Unix and LinuxUnix and Linux
Unix and Linux
vikas mishra
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
Bhushan Pawar -Java Trainer
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Techronology Inc.
 
LINUX Admin Quick Reference
LINUX Admin Quick ReferenceLINUX Admin Quick Reference
LINUX Admin Quick Referencewensheng wei
 
Linux system administration
Linux system administrationLinux system administration
Linux system administration
orionsconsulting
 
FTP Server
FTP ServerFTP Server
FTP Server
Rafly Rafly
 
Linux files
Linux filesLinux files
Linux files
Geeta Vinnakota
 
Linux-Permission
Linux-PermissionLinux-Permission
Linux-Permission
Colin Su
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structureTeja Bheemanapally
 
Double level directory structure 55(1)
Double level directory structure 55(1)Double level directory structure 55(1)
Double level directory structure 55(1)myrajendra
 
File permissions
File permissionsFile permissions
File permissions
Varnnit Jain
 
Kernal
KernalKernal
Kernal
Ramasubbu .P
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
Rai University
 
Fat and ntfs
Fat and ntfsFat and ntfs
Fat and ntfsLucky Ali
 
Webmin configuration in Linux
Webmin configuration in LinuxWebmin configuration in Linux
Webmin configuration in LinuxThamizharasan P
 

Viewers also liked (20)

Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
File management ppt
File management pptFile management ppt
File management ppt
 
File management
File managementFile management
File management
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
 
Unix and Linux
Unix and LinuxUnix and Linux
Unix and Linux
 
Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
LINUX Admin Quick Reference
LINUX Admin Quick ReferenceLINUX Admin Quick Reference
LINUX Admin Quick Reference
 
Linux system administration
Linux system administrationLinux system administration
Linux system administration
 
Ntfs
NtfsNtfs
Ntfs
 
FTP Server
FTP ServerFTP Server
FTP Server
 
Linux files
Linux filesLinux files
Linux files
 
Linux-Permission
Linux-PermissionLinux-Permission
Linux-Permission
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structure
 
Double level directory structure 55(1)
Double level directory structure 55(1)Double level directory structure 55(1)
Double level directory structure 55(1)
 
File permissions
File permissionsFile permissions
File permissions
 
Kernal
KernalKernal
Kernal
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
 
Fat and ntfs
Fat and ntfsFat and ntfs
Fat and ntfs
 
Webmin configuration in Linux
Webmin configuration in LinuxWebmin configuration in Linux
Webmin configuration in Linux
 

Similar to Management file and directory in linux

linux-file-system01.ppt
linux-file-system01.pptlinux-file-system01.ppt
linux-file-system01.ppt
MeesanRaza
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
norhloudspeaker
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
Shashwat Shriparv
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
Vu Hung Nguyen
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
David Harris
 
Linux
LinuxLinux
Degonto, File management system in fisheries science
Degonto, File management  system in fisheries scienceDegonto, File management  system in fisheries science
Degonto, File management system in fisheries science
Degonto Islam
 
Linux day 2.ppt
Linux day  2.pptLinux day  2.ppt
Linux day 2.ppt
Kalkey
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Unit3 browsing the filesystem
Unit3 browsing the filesystemUnit3 browsing the filesystem
Unit3 browsing the filesystemroot_fibo
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
Gourav Varma
 
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
Syaiful Ahdan
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
EngrNabidRayhanKhale
 
Linux
LinuxLinux

Similar to Management file and directory in linux (20)

linux-file-system01.ppt
linux-file-system01.pptlinux-file-system01.ppt
linux-file-system01.ppt
 
Edubooktraining
EdubooktrainingEdubooktraining
Edubooktraining
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
File system discovery
File system discovery File system discovery
File system discovery
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
 
Linux
LinuxLinux
Linux
 
Degonto, File management system in fisheries science
Degonto, File management  system in fisheries scienceDegonto, File management  system in fisheries science
Degonto, File management system in fisheries science
 
Linux day 2.ppt
Linux day  2.pptLinux day  2.ppt
Linux day 2.ppt
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
File Management
File ManagementFile Management
File Management
 
File Management
File ManagementFile Management
File Management
 
Unit3 browsing the filesystem
Unit3 browsing the filesystemUnit3 browsing the filesystem
Unit3 browsing the filesystem
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
Operating System Practice : Meeting 4 - operasi file dan struktur direktori-s...
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
 
Linux
LinuxLinux
Linux
 

Recently uploaded

Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 

Recently uploaded (20)

Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 

Management file and directory in linux

  • 1. Chapter three Managing Files and Directories Prepare by zkre S Saleh This chapter explores the general format of your Red Hat Enterprise Linux system. It bridges the differences between using Nautilus to manage the files on your system and using a shell prompt to manage them. It does not go into the minute details of using a shell prompt; those will be covered in Chapter 4 Shell Prompt Basics. This chapter orients you to the system as a whole, and then you can choose which method of management you prefer.
  • 2. File System Terms  extension An extension is that part of a filename that is found after the final ".". In the filename foo.txt ".txt" is the le's extension. Extensions are used to indicate le type.  path A path is the string of directories and sub-directories you would have to navigate through in order to reach a given location in the le system.
  • 3. File System Terms  root access To have root access means to be logged in using the root account. This can be done from the main login screen, a shell prompt, or any application that requires your root password. Root access means that the user has permission to do anything on the system, so use root access with care.  root directory The root directory is the top-most directory of the le system. All other les and directories exist in this directory or one of its sub-directories. Do not confuse the root directory, /, with root's home directory, /root/.
  • 4. A Larger Picture of the File System  Every operating system has a method of storing data in files and directories so that it can keep track  of additions, modifications, and other changes. In Red Hat Enterprise Linux, every file is stored in  a directory. Directories can also contain directories: these subdirectories may also contain files and  other subdirectories. You might think of the le system as a tree and directories as branches.  away the directories branch, everything is connected to the root directory, which is represented as a  singe forward slash (/).
  • 6. Managing Files  File Types  Naming Conventions  Finding the Correct File Extension
  • 7. Managing Files  File Types
  • 8. Managing Files  File Types Compressed and Archived Files .bz2. a file compressed with bzip2 .gz. a file compressed with gzip . .tar. a file archived with tar (short for tape archive), also known as a tar file . .tbz or .tar.bz. a tarred and bzipped le . .tgz or .tar.gz. a tarred and gzipped le . .zip.a le compressed with ZIP compression, commonly found in MS-DOS applications; most compressed les for Linux use the gzip compression, so nding a .zip archive for Linux les is rare
  • 9. Managing Files  File Types File Formats .au. an audio le .gif. a GIF image le (short for Graphics Interchange Format) .html or .htm. an HTML le (short for Hyper Text Markup Language) .jpg. a JPEG image le (short for Joint Photographic Experts Group) .pdf. an electronic image of a document; PDF stands for Portable Document Format .png. a PNG image le (short for Portable Network Graphic) .ps. a PostScript file; formatted for printing .txt. a plain ASCII text file .wav. an audio le .xpm. an image le (short for X Pixelmap)
  • 10. Managing Files  File Types  Programming and Scripting Files .c . a C program language source code le .cpp . a C++ program language source code le .h . a C or C++ program language header le .o . a program object le .pl . a Perl script .py. a Python script .so . a library file .sh. a shell script .tcl . a TCL script
  • 11. Managing Files  File Types  Naming Conventions  Finding the Correct File Extension
  • 12. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions
  • 13. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions
  • 14. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions Files whose name begins with a ".", called "dot" files, are hidden files. These files can be viewed in both graphical file managers like Nautilus and from the shell prompt, but require an extra step to reveal them. command ls –al used for view the hidden files in your home directory, How to make hidden file or folder ? Touch .extension Mkdir .extension
  • 15. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions While Linux allows file names with spaces in them, manipulating these files from a shell prompt can be quite cumbersome.
  • 16. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions It is possible to use punctuation marks in your file names. However, be aware that these special characters have special meaning to the shell and may cause errors at a shell prompt. It is generally recommended that you avoid using special characters in file names for this reason. If you choose to use file names with special characters, use quotes around the file names when manipulating them from a shell prompt. You cannot use a "/" — this indicates a directory.
  • 17. Managing Files  Naming Conventions  Dot Files  Using Spaces in File Names  Using Symbols in File Names  Files with Multiple Extensions
  • 18. File Compression and Archiving File Compression and Archiving It is useful to store a group of files in one file for easy backup, for transfer to another directory, or for transfer to another computer. It is also useful to compress large files; compressed files take up less disk space and download faster via the Internet. It is important to understand the distinction between an archive file and a compressed file. An archive file is a collection of files and directories stored in one file. The archive file is not compressed — it uses the same amount of disk space as all the individual files and directories combined. A compressed file is a collection of files and directories that are stored in one file and stored in a way that uses less disk space than all the individual files and directories combined. If disk space is a concern, compress rarely-used files, or place all such files in a single archive file and compress it.
  • 19. File Compression and Archiving with GUI  Applications >> accessories >> archive manager
  • 20. File Compression and Archiving  Shell prompt Compression Tool File Extension Decompression Tool bzip2 .bz2 bunzip2 gzip .gz Gunzip zip .zip Unzip
  • 21. File Compression and Archiving  Shell prompt Bzip2 and Bunzip2 bzip2 filename. extinction bunzip2 filename.ext.bz2
  • 22. File Compression and Archiving  Shell prompt gzip2 and gunzip2 Gzip filename. extinction Gunzip filename.ext.gz
  • 23. File Compression and Archiving  Shell prompt Zip unzip To compress a file with zip, enter the following command: zip -r filename.zip filesdir The -r option specifies that you want to include all files contained in the filesdir directory recursively. Zip –r filename.zip collection items Zip –r z.zip a b s q.png
  • 24. File Compression and Archiving  Tar Tar –cvf coll.tar 1 2 3 4 5 6 dirA dirB dirC Filename for archiving
  • 25. File Compression and Archiving List Content of tar Archive File Tar –tvf coll.tar Add Files or Directories to tar Archive File Tar –rvf coll.tar 1 2 3 4 5 6 Check the Size of the tar, tar.gz and tar.bz2 Archive File Tar –czf – coll.tar | wc -c
  • 26. File Compression and Archiving  Tar Compression and Archiving z.Tar >>>> z.tar.gz Gzip z.tar
  • 27. Managing Files and Directories  Creating Directories  Deleting Directories  Dot Directories .  Right-click on Desktop select Create Folder Change name with you want To create a new directory using a shell prompt, use the command mkdir. Enter: mkdir
  • 28. Managing Files and Directories  Creating Directories  Deleting Directories  Dot Directories .  right click on it and choose Move to Trash, or click and drag the icon to the Trash on the Desktop. To delete an empty directory from a shell prompt, enter the command rmdir. To delete a directory that may not be empty (and consequently everything inside that directory), enter the command rm - rf <directory>.
  • 29. Managing Files and Directories  Creating Directories  Deleting Directories  Dot Directories  Mkdir .name
  • 30. Thank you for watched

Editor's Notes

  1. Here class A stop
  2. Here A class stop
  3.  Add Files or Directories to tar Archive File