SlideShare a Scribd company logo
1 of 5
Directory Management
• A directory is a file the solo job of which is to store the file names and the related information.
All the files, whether ordinary, special, or directory, are contained in directories.
• Unix uses a hierarchical structure for organizing files and directories.
• This structure is often referred to as a directory tree. The tree has a single root node, the slash
character (/), and all other directories are contained below it.
• You can go in your home directory anytime using the following command −
$cd ~
$
Here ~ indicates the home directory.
Suppose you have to go in any other user's home directory, use the following command –
$cd ~username
$
To go in your last directory, you can use the following command –
$cd -
$
Directory Management
Absolute/Relative Pathnames
• Directories are arranged in a hierarchy with root (/) at the top.
• The position of any file within the hierarchy is described by its pathname.
• Elements of a pathname are separated by a /.
• A pathname is absolute, if it is described in relation to root, thus absolute pathnames always
begin with a /.
• Following are some examples of absolute filenames.
/etc/passwd
/users/sjones/chem/notes
/dev/rdsk/Os3
• A pathname can also be relative to your current working directory.
• Relative pathnames never begin with /.
• Relative to user amrood's home directory, some pathnames might look like this–
chem/notes personal/res
• To determine where you are within the filesystem hierarchy at any time, enter the command
pwd to print the current working directory – $pwd
/user0/home/amrood
$
Listing Directories
• To list the files in a directory, you can use the following syntax −
$ ls dirname
• Following is the example to list all the files contained in /usr/local directory –
$ ls /usr/local
X11 Bin gimp jikes sbin
ace Doc include lib share
Atalk Etc info man ami
Creating Directories
•We will now understand how to create directories. Directories are created by the following
command −
$ mkdir dirname
Here, directory is the absolute or relative pathname of the directory you want to create.
For example, the command –
$mkdir mydir
$
Creates the directory mydir in the current directory. Here is another example –
$mkdir /tmp/test-dir
$
•This command creates the directory test-dir in the /tmp directory.
•The mkdir command produces no output if it successfully creates the requested directory.
•If you give more than one directory on the command line, mkdir creates each of the directories.
For example, −
$mkdir docs pub
$
Creates the directories docs and pub under the current directory.
Creating Parent Directories
•Sometimes when you want to create a directory, its parent directory or directories
might not exist.
•In this case, mkdir issues an error message as follows −
$mkdir /tmp/amrood/test
mkdir: Failed to make directory "/tmp/amrood/test";
No such file or directory
$
In such cases, you can specify the -p option to the mkdir command. It creates all the
necessary directories for you. For example –
$mkdir -p /tmp/amrood/test
$ The above command creates all the required parent directories
Removing Directories
• Directories can be deleted using the rmdir command as follows −
$rmdir dirname
$
•You can remove multiple directories at a time as follows −
$rmdir dirname1 dirname2 dirname3
$
•The above command removes the all directories
Changing Directories
•You can use the cd command to do change directory. The syntax is as given below −
$cd dirname $
$cd dirname $
Renaming Directories
•The mv (move) command can also be used to rename a directory. The syntax is as follows:
$mv olddir newdir
$
e.g.You can rename a directory mydir to yourdir as follows –
$mv mydir yourdir
$

More Related Content

What's hot

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management SystemHardik Patil
 
Process creation and termination In Operating System
Process creation and termination In Operating SystemProcess creation and termination In Operating System
Process creation and termination In Operating SystemFarhan Aslam
 
Query-porcessing-& Query optimization
Query-porcessing-& Query optimizationQuery-porcessing-& Query optimization
Query-porcessing-& Query optimizationSaranya Natarajan
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generatorsanchi29
 
Chapter 3 instruction level parallelism and its exploitation
Chapter 3 instruction level parallelism and its exploitationChapter 3 instruction level parallelism and its exploitation
Chapter 3 instruction level parallelism and its exploitationsubramaniam shankar
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Top down parsering and bottom up parsering.pptx
Top down parsering and bottom up parsering.pptxTop down parsering and bottom up parsering.pptx
Top down parsering and bottom up parsering.pptxLaibaFaisal3
 
Transaction processing ppt
Transaction processing pptTransaction processing ppt
Transaction processing pptJaved Khan
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimizationKumar
 
Transaction Processing its properties & States
Transaction Processing its properties & StatesTransaction Processing its properties & States
Transaction Processing its properties & StatesMeghaj Mallick
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Ahead
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road AheadAmazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Ahead
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Aheadinside-BigData.com
 
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...Spark Summit
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 

What's hot (20)

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Xml
XmlXml
Xml
 
Distributed Database Management System
Distributed Database Management SystemDistributed Database Management System
Distributed Database Management System
 
Process creation and termination In Operating System
Process creation and termination In Operating SystemProcess creation and termination In Operating System
Process creation and termination In Operating System
 
Query-porcessing-& Query optimization
Query-porcessing-& Query optimizationQuery-porcessing-& Query optimization
Query-porcessing-& Query optimization
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
 
NFA to DFA
NFA to DFANFA to DFA
NFA to DFA
 
Chapter 3 instruction level parallelism and its exploitation
Chapter 3 instruction level parallelism and its exploitationChapter 3 instruction level parallelism and its exploitation
Chapter 3 instruction level parallelism and its exploitation
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Top down parsering and bottom up parsering.pptx
Top down parsering and bottom up parsering.pptxTop down parsering and bottom up parsering.pptx
Top down parsering and bottom up parsering.pptx
 
LR PARSE.pptx
LR PARSE.pptxLR PARSE.pptx
LR PARSE.pptx
 
Transaction processing ppt
Transaction processing pptTransaction processing ppt
Transaction processing ppt
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
 
Transaction Processing its properties & States
Transaction Processing its properties & StatesTransaction Processing its properties & States
Transaction Processing its properties & States
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Ahead
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road AheadAmazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Ahead
Amazon Elastic Fabric Adapter: Anatomy, Capabilities, and the Road Ahead
 
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
Deep Dive into Project Tungsten: Bringing Spark Closer to Bare Metal-(Josh Ro...
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Denormalization
DenormalizationDenormalization
Denormalization
 
System calls
System callsSystem calls
System calls
 

Similar to Directory Management in Unix

BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
 
Linux - Directory commands
Linux - Directory commandsLinux - Directory commands
Linux - Directory commandsjoesofi
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Ahmed El-Arabawy
 
Unix primer
Unix primerUnix primer
Unix primerdummy
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line ToolsDavid Harris
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystemShay Cohen
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdfamitkamble79
 
Unit3 browsing the filesystem
Unit3 browsing the filesystemUnit3 browsing the filesystem
Unit3 browsing the filesystemroot_fibo
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualKuntal Bhowmick
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptxPriyadarshini648418
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating SystemMeqdad Darweesh
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2Gourav Varma
 
101 3.3 perform basic file management
101 3.3 perform basic file management101 3.3 perform basic file management
101 3.3 perform basic file managementAcácio Oliveira
 
Basic command of hadoop
Basic command of hadoopBasic command of hadoop
Basic command of hadoopAhmad Kabeer
 
Chapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptxChapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptxalehegn9
 

Similar to Directory Management in Unix (20)

BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Linux - Directory commands
Linux - Directory commandsLinux - Directory commands
Linux - Directory commands
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
 
LinuxLabBasics.ppt
LinuxLabBasics.pptLinuxLabBasics.ppt
LinuxLabBasics.ppt
 
Unix primer
Unix primerUnix primer
Unix primer
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystem
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
Unit3 browsing the filesystem
Unit3 browsing the filesystemUnit3 browsing the filesystem
Unit3 browsing the filesystem
 
Directories description
Directories descriptionDirectories description
Directories description
 
Part 2
Part 2Part 2
Part 2
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manual
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
DOS - Disk Operating System
DOS - Disk Operating SystemDOS - Disk Operating System
DOS - Disk Operating System
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
 
101 3.3 perform basic file management
101 3.3 perform basic file management101 3.3 perform basic file management
101 3.3 perform basic file management
 
Basic command of hadoop
Basic command of hadoopBasic command of hadoop
Basic command of hadoop
 
Chapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptxChapter 2 Linux File System and net.pptx
Chapter 2 Linux File System and net.pptx
 

More from Vpmv

Operating System.ppt
Operating System.pptOperating System.ppt
Operating System.pptVpmv
 
Classification of Computers.pdf
Classification of Computers.pdfClassification of Computers.pdf
Classification of Computers.pdfVpmv
 
Basic Components of Computer....pdf
Basic Components of Computer....pdfBasic Components of Computer....pdf
Basic Components of Computer....pdfVpmv
 
Algorithm & Flowchart.pdf
Algorithm & Flowchart.pdfAlgorithm & Flowchart.pdf
Algorithm & Flowchart.pdfVpmv
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread ManagementVpmv
 
Evolution or Generation of OS.pdf
 Evolution or Generation of OS.pdf Evolution or Generation of OS.pdf
Evolution or Generation of OS.pdfVpmv
 
Introduction of OS & Classification of Software
Introduction of OS & Classification of SoftwareIntroduction of OS & Classification of Software
Introduction of OS & Classification of SoftwareVpmv
 
Case, Loop & Command line args un Unix
Case, Loop & Command line args un UnixCase, Loop & Command line args un Unix
Case, Loop & Command line args un UnixVpmv
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODEVpmv
 
Stucture of c program
Stucture of c programStucture of c program
Stucture of c programVpmv
 
Network topology
Network topologyNetwork topology
Network topologyVpmv
 

More from Vpmv (11)

Operating System.ppt
Operating System.pptOperating System.ppt
Operating System.ppt
 
Classification of Computers.pdf
Classification of Computers.pdfClassification of Computers.pdf
Classification of Computers.pdf
 
Basic Components of Computer....pdf
Basic Components of Computer....pdfBasic Components of Computer....pdf
Basic Components of Computer....pdf
 
Algorithm & Flowchart.pdf
Algorithm & Flowchart.pdfAlgorithm & Flowchart.pdf
Algorithm & Flowchart.pdf
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
 
Evolution or Generation of OS.pdf
 Evolution or Generation of OS.pdf Evolution or Generation of OS.pdf
Evolution or Generation of OS.pdf
 
Introduction of OS & Classification of Software
Introduction of OS & Classification of SoftwareIntroduction of OS & Classification of Software
Introduction of OS & Classification of Software
 
Case, Loop & Command line args un Unix
Case, Loop & Command line args un UnixCase, Loop & Command line args un Unix
Case, Loop & Command line args un Unix
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODE
 
Stucture of c program
Stucture of c programStucture of c program
Stucture of c program
 
Network topology
Network topologyNetwork topology
Network topology
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

Directory Management in Unix

  • 1. Directory Management • A directory is a file the solo job of which is to store the file names and the related information. All the files, whether ordinary, special, or directory, are contained in directories. • Unix uses a hierarchical structure for organizing files and directories. • This structure is often referred to as a directory tree. The tree has a single root node, the slash character (/), and all other directories are contained below it. • You can go in your home directory anytime using the following command − $cd ~ $ Here ~ indicates the home directory. Suppose you have to go in any other user's home directory, use the following command – $cd ~username $ To go in your last directory, you can use the following command – $cd - $
  • 2. Directory Management Absolute/Relative Pathnames • Directories are arranged in a hierarchy with root (/) at the top. • The position of any file within the hierarchy is described by its pathname. • Elements of a pathname are separated by a /. • A pathname is absolute, if it is described in relation to root, thus absolute pathnames always begin with a /. • Following are some examples of absolute filenames. /etc/passwd /users/sjones/chem/notes /dev/rdsk/Os3 • A pathname can also be relative to your current working directory. • Relative pathnames never begin with /. • Relative to user amrood's home directory, some pathnames might look like this– chem/notes personal/res • To determine where you are within the filesystem hierarchy at any time, enter the command pwd to print the current working directory – $pwd /user0/home/amrood $
  • 3. Listing Directories • To list the files in a directory, you can use the following syntax − $ ls dirname • Following is the example to list all the files contained in /usr/local directory – $ ls /usr/local X11 Bin gimp jikes sbin ace Doc include lib share Atalk Etc info man ami Creating Directories •We will now understand how to create directories. Directories are created by the following command − $ mkdir dirname Here, directory is the absolute or relative pathname of the directory you want to create. For example, the command – $mkdir mydir $ Creates the directory mydir in the current directory. Here is another example – $mkdir /tmp/test-dir $
  • 4. •This command creates the directory test-dir in the /tmp directory. •The mkdir command produces no output if it successfully creates the requested directory. •If you give more than one directory on the command line, mkdir creates each of the directories. For example, − $mkdir docs pub $ Creates the directories docs and pub under the current directory. Creating Parent Directories •Sometimes when you want to create a directory, its parent directory or directories might not exist. •In this case, mkdir issues an error message as follows − $mkdir /tmp/amrood/test mkdir: Failed to make directory "/tmp/amrood/test"; No such file or directory $ In such cases, you can specify the -p option to the mkdir command. It creates all the necessary directories for you. For example – $mkdir -p /tmp/amrood/test $ The above command creates all the required parent directories
  • 5. Removing Directories • Directories can be deleted using the rmdir command as follows − $rmdir dirname $ •You can remove multiple directories at a time as follows − $rmdir dirname1 dirname2 dirname3 $ •The above command removes the all directories Changing Directories •You can use the cd command to do change directory. The syntax is as given below − $cd dirname $ $cd dirname $ Renaming Directories •The mv (move) command can also be used to rename a directory. The syntax is as follows: $mv olddir newdir $ e.g.You can rename a directory mydir to yourdir as follows – $mv mydir yourdir $