SlideShare a Scribd company logo
1 of 12
bhatvijetha
Various options on cd and ls command
There are two types of shell commands:
Built-in shell commands: They are part of a shell. Each
shell has some built in commands.
External/Linux commands: Each external command is a
separate executable program written in C or other
programming languages.
Directory Command Description
Pwd: The pwd command stands for (print working directory).
It displays the current working location or directory of the user.
It displays the whole working path starting with /.
It is a built-in command.
ls: The ls command is used to show the list of a folder.
It will list out all the files in the directed folder.
cd: The cd command stands for (change directory).
It is used to change to the directory you want to work from the
present directory.
mkdir: With mkdir command you can create your own directory.
rmdir: The rmdir command is used to remove a directory from your
system.
Linux cd Command
The "cd" stands for 'change directory' and this command is used to
change the current directory i.e; the directory in which the user is
currently working.
Syntax:
cd <dirname>
Example:
cd certs
cd Options
cd ~ :Brings you to your home directory.
cd - :Brings you to your previous directory of the
current directory.
cd .. :Brings you to the parent directory of current
directory.
cd / :It takes you to the entire system's root directory.
cd ../ ../dir1/dir2 :It will take you two directories up
then move to dir1 and then finally to dir2.
Linux ls command
The ls is the list command in Linux.
It will show the full list or content of your directory.
Just type ls and press enter key.
The whole content will be shown.
Example:
ls
ls –a
In Linux, hidden files start with . (dot) symbol and they are not visible in
the regular directory.
The (ls -a) command will enlist the whole list of the current directory
including the hidden files.
ls –l
It will show the list in a long list format.
ls –lh
This command will show you the file sizes in human readable format.
Size of the file is very difficult to read when displayed in terms of byte.
The (ls -lh)command will give you the data in terms of Mb, Gb, Tb, etc.
ls –lhS
If you want to display your files in descending order (highest at the top)
according to their size, then you can use (ls -lhS) command.
ls –li
This command prints the index number if file in the first
column.
ls –p
It is used to identify the directory easily by marking the
directories with a slash (/) line sign.
 ls –r
It is used to print the list in reverse order.
ls –R
It will display the content of the sub-directories also.
 ls –lX
It will group the files with same extensions together in the
list.
ls –lt
It will sort the list by displaying recently modified filed
at top.
ls ~
It gives the contents of home directory.
ls ../
It give the contents of parent directory.
ls –version
It checks the version of ls command.
Linux mkdir | Linux Create Directory
The mkdir stands for 'make directory'.
With the help of mkdir command, you can create a new
directory wherever you want in your system.
Just type "mkdir <dir name> , in place of <dir name>
type the name of new directory, you want to create
and then press enter.
Syntax:
mkdir <dirname>
Example:
mkdir created
linux rmdir command
This command is used to delete a directory.
But will not be able to delete a directory including a
sub-directory.
It means, a directory has to be empty to be deleted.
Syntax:
rmdir <dirname>
Example:
rmdir created
Linux directory commands:more options on cd and ls command

More Related Content

What's hot

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...Jim Birch
 
Linux commd
Linux commdLinux commd
Linux commdragav03
 
Linux commd
Linux commdLinux commd
Linux commdragav03
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command promptsAhmed Hesham
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands Raghav Arora
 
Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Noé Fernández-Pozo
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 

What's hot (12)

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Linux commd
Linux commdLinux commd
Linux commd
 
Linux commd
Linux commdLinux commd
Linux commd
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
CMD Command prompts
CMD Command promptsCMD Command prompts
CMD Command prompts
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 

Similar to Linux directory commands:more options on cd and ls command

linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdfamitkamble79
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.pptLuigysToro
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command ShellTushar B Kute
 
Basics of UNIX Commands
Basics of UNIX CommandsBasics of UNIX Commands
Basics of UNIX CommandsSubra Das
 
Linux commands
Linux commandsLinux commands
Linux commandsU.P Police
 
35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdfMangesh Dhulap
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigationhetaldobariya
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
BASICS OF LINUX OPERATING SYSTEM.pptx
BASICS OF LINUX OPERATING SYSTEM.pptxBASICS OF LINUX OPERATING SYSTEM.pptx
BASICS OF LINUX OPERATING SYSTEM.pptxAlkaYadav79
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritpingchockit88
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUXAVI DHALL
 

Similar to Linux directory commands:more options on cd and ls command (20)

linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Linux
LinuxLinux
Linux
 
Basics of UNIX Commands
Basics of UNIX CommandsBasics of UNIX Commands
Basics of UNIX Commands
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Directories description
Directories descriptionDirectories description
Directories description
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
BASICS OF LINUX OPERATING SYSTEM.pptx
BASICS OF LINUX OPERATING SYSTEM.pptxBASICS OF LINUX OPERATING SYSTEM.pptx
BASICS OF LINUX OPERATING SYSTEM.pptx
 
LinuxLabBasics.ppt
LinuxLabBasics.pptLinuxLabBasics.ppt
LinuxLabBasics.ppt
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUX
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux Command.ppsx
Linux Command.ppsxLinux Command.ppsx
Linux Command.ppsx
 

More from bhatvijetha

LINUX:Control statements in shell programming
LINUX:Control statements in shell programmingLINUX:Control statements in shell programming
LINUX:Control statements in shell programmingbhatvijetha
 
Shellvariables in Linux
Shellvariables in Linux Shellvariables in Linux
Shellvariables in Linux bhatvijetha
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filtersbhatvijetha
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unixbhatvijetha
 

More from bhatvijetha (6)

LINUX:Control statements in shell programming
LINUX:Control statements in shell programmingLINUX:Control statements in shell programming
LINUX:Control statements in shell programming
 
Shellvariables in Linux
Shellvariables in Linux Shellvariables in Linux
Shellvariables in Linux
 
Vi editor
Vi editorVi editor
Vi editor
 
Unix vs linux
Unix vs linuxUnix vs linux
Unix vs linux
 
Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
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
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
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
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.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
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
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 🔝✔️✔️
 

Linux directory commands:more options on cd and ls command

  • 1. bhatvijetha Various options on cd and ls command
  • 2. There are two types of shell commands: Built-in shell commands: They are part of a shell. Each shell has some built in commands. External/Linux commands: Each external command is a separate executable program written in C or other programming languages.
  • 3. Directory Command Description Pwd: The pwd command stands for (print working directory). It displays the current working location or directory of the user. It displays the whole working path starting with /. It is a built-in command. ls: The ls command is used to show the list of a folder. It will list out all the files in the directed folder. cd: The cd command stands for (change directory). It is used to change to the directory you want to work from the present directory. mkdir: With mkdir command you can create your own directory. rmdir: The rmdir command is used to remove a directory from your system.
  • 4. Linux cd Command The "cd" stands for 'change directory' and this command is used to change the current directory i.e; the directory in which the user is currently working. Syntax: cd <dirname> Example: cd certs
  • 5. cd Options cd ~ :Brings you to your home directory. cd - :Brings you to your previous directory of the current directory. cd .. :Brings you to the parent directory of current directory. cd / :It takes you to the entire system's root directory. cd ../ ../dir1/dir2 :It will take you two directories up then move to dir1 and then finally to dir2.
  • 6. Linux ls command The ls is the list command in Linux. It will show the full list or content of your directory. Just type ls and press enter key. The whole content will be shown. Example: ls
  • 7. ls –a In Linux, hidden files start with . (dot) symbol and they are not visible in the regular directory. The (ls -a) command will enlist the whole list of the current directory including the hidden files. ls –l It will show the list in a long list format. ls –lh This command will show you the file sizes in human readable format. Size of the file is very difficult to read when displayed in terms of byte. The (ls -lh)command will give you the data in terms of Mb, Gb, Tb, etc. ls –lhS If you want to display your files in descending order (highest at the top) according to their size, then you can use (ls -lhS) command.
  • 8. ls –li This command prints the index number if file in the first column. ls –p It is used to identify the directory easily by marking the directories with a slash (/) line sign.  ls –r It is used to print the list in reverse order. ls –R It will display the content of the sub-directories also.  ls –lX It will group the files with same extensions together in the list.
  • 9. ls –lt It will sort the list by displaying recently modified filed at top. ls ~ It gives the contents of home directory. ls ../ It give the contents of parent directory. ls –version It checks the version of ls command.
  • 10. Linux mkdir | Linux Create Directory The mkdir stands for 'make directory'. With the help of mkdir command, you can create a new directory wherever you want in your system. Just type "mkdir <dir name> , in place of <dir name> type the name of new directory, you want to create and then press enter. Syntax: mkdir <dirname> Example: mkdir created
  • 11. linux rmdir command This command is used to delete a directory. But will not be able to delete a directory including a sub-directory. It means, a directory has to be empty to be deleted. Syntax: rmdir <dirname> Example: rmdir created