SlideShare a Scribd company logo
Linux Basic Commands
Complete Common File System Tasks
 Navigating the file system
 Managing files and directories
• Navigating the File System
 pwd (Present Working Directory)
 cd
 ls
Using the pwd Command
pwd stands for Print Working Directory or Present
Working Directory
It prints the path of the working directory, starting
from the root.
This is necessary as it let you know where your files
are saved.
Syntax: $ pwd
Using the cd Command
cd command in Linux known as change directory
command. It is used to change current working directory.
Syntax:
$ cd [directory]
Example: $ cd dir1
To move back to parent directory:
$cd ..
Using the ls Command
ls is a Linux shell command that lists directory contents
of files and directories.
Syntax: ls [options]
ls
 –a Displays all files, including hidden files.
 –l Displays a long listing of the directory
contents. This is a very useful option. You can
use it to see the file names, ownership,
permissions, modification date, and size.
 –R Displays directory contents recursively;
that is, it displays the contents of the current
directory as well as the contents of all
subdirectories.
• Managing files and directories
 Creating files and directories
 Viewing file contents
 Deleting files and directories
 Copying and moving files and directories
Creating Directories
 mkdir command in Linux allows the user to create
directories (also referred to as folders in some
operating systems ). This command can create
multiple directories at once
 Syntax: $ mkdir new_directory
Viewing Text File Contents
cat
 It reads data from the file and gives their
content as output. It helps us to create, view,
concatenate files.
 The cat filename command will display the
specified text file on screen.
 Syntax: $ cat filename
Deleting Files and Directories
 rmdir
 rm
rmdir
 This utility can be used to delete an existing
directory. To use it, simply enter
 rmdir directory_name
 For example, rmdir MyFiles.
 Be aware, however, that rmdir requires that
the directory be empty before it will delete it.
rm
 The rm utility is a more powerful deletion utility
that can be used to delete either a file or a
populated directory.
 To delete a file, simply enter rm filename.
 To delete a directory, enter
rm –r directory_name.
rm
 Be careful with rm! By default, it won’t prompt
you to confirm a deletion operation. It assumes
that you really meant to delete the file or
directory.
 If you want rm to prompt you before deleting a
file or directory, include the –i option.
Copying and Moving Files and
Directories
 cp
 mv
cp
 This utility is used to copy files or entire
directory structures from one location in the file
system to another.
 For example, to copy a file named
/tmp/schedule.txt to your home directory, you
could enter
cp /tmp/schedule.txt ~.
mv
 The mv command is used much like cp.
However, it will copy the specified file to the
new location in the file system and then delete
the original.
 For example, to move a file named mylog.txt
from /tmp to /var/log, you would enter
 mv /tmp/mylog.txt /var/log
mv
 The mv command is also used to rename
files. Simply enter mv followed by the file to be
renamed and then the new file name.
 For example, to rename schedule.txt to
schedule.old, you would enter
mv schedule.txt schedule.old.

More Related Content

Similar to LinuxLabBasics.ppt

Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Linux commands
Linux commandsLinux commands
Linux commands
penetration Tester
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
David Harris
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
MarsMox
 
Linux commands
Linux commandsLinux commands
Linux commandsU.P Police
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Shakeel Shafiq
 
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
Kuntal Bhowmick
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.Sivakumar
Sivakumar R D .
 
Directories description
Directories descriptionDirectories description
Directories description
Dr.M.Karthika parthasarathy
 
Internal commands of dos
Internal commands of dosInternal commands of dos
Internal commands of dos
Nargiskhan786
 
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
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic Commands
Shankar Mahure
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
LuigysToro
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Dheeraj Nambiar
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to LinuxDimas Prasetyo
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
bhatvijetha
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
Zkre Saleh
 
linux cmds.pptx
linux cmds.pptxlinux cmds.pptx
linux cmds.pptx
divyanshianand3
 

Similar to LinuxLabBasics.ppt (20)

Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
 
Linux_Commands.pdf
Linux_Commands.pdfLinux_Commands.pdf
Linux_Commands.pdf
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
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
 
Directory Commands - R.D.Sivakumar
Directory Commands - R.D.SivakumarDirectory Commands - R.D.Sivakumar
Directory Commands - R.D.Sivakumar
 
Directories description
Directories descriptionDirectories description
Directories description
 
Internal commands of dos
Internal commands of dosInternal commands of dos
Internal commands of dos
 
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
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic Commands
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls commandLinux directory commands:more options on cd and ls command
Linux directory commands:more options on cd and ls command
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
 
linux cmds.pptx
linux cmds.pptxlinux cmds.pptx
linux cmds.pptx
 

Recently uploaded

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
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
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
 
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
 
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
 
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
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
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
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 

Recently uploaded (20)

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
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
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
 
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
 
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
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.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
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 

LinuxLabBasics.ppt

  • 2. Complete Common File System Tasks  Navigating the file system  Managing files and directories
  • 3. • Navigating the File System  pwd (Present Working Directory)  cd  ls
  • 4. Using the pwd Command pwd stands for Print Working Directory or Present Working Directory It prints the path of the working directory, starting from the root. This is necessary as it let you know where your files are saved. Syntax: $ pwd
  • 5. Using the cd Command cd command in Linux known as change directory command. It is used to change current working directory. Syntax: $ cd [directory] Example: $ cd dir1 To move back to parent directory: $cd ..
  • 6. Using the ls Command ls is a Linux shell command that lists directory contents of files and directories. Syntax: ls [options]
  • 7. ls  –a Displays all files, including hidden files.  –l Displays a long listing of the directory contents. This is a very useful option. You can use it to see the file names, ownership, permissions, modification date, and size.  –R Displays directory contents recursively; that is, it displays the contents of the current directory as well as the contents of all subdirectories.
  • 8. • Managing files and directories  Creating files and directories  Viewing file contents  Deleting files and directories  Copying and moving files and directories
  • 9. Creating Directories  mkdir command in Linux allows the user to create directories (also referred to as folders in some operating systems ). This command can create multiple directories at once  Syntax: $ mkdir new_directory
  • 10. Viewing Text File Contents cat  It reads data from the file and gives their content as output. It helps us to create, view, concatenate files.  The cat filename command will display the specified text file on screen.  Syntax: $ cat filename
  • 11. Deleting Files and Directories  rmdir  rm
  • 12. rmdir  This utility can be used to delete an existing directory. To use it, simply enter  rmdir directory_name  For example, rmdir MyFiles.  Be aware, however, that rmdir requires that the directory be empty before it will delete it.
  • 13. rm  The rm utility is a more powerful deletion utility that can be used to delete either a file or a populated directory.  To delete a file, simply enter rm filename.  To delete a directory, enter rm –r directory_name.
  • 14. rm  Be careful with rm! By default, it won’t prompt you to confirm a deletion operation. It assumes that you really meant to delete the file or directory.  If you want rm to prompt you before deleting a file or directory, include the –i option.
  • 15. Copying and Moving Files and Directories  cp  mv
  • 16. cp  This utility is used to copy files or entire directory structures from one location in the file system to another.  For example, to copy a file named /tmp/schedule.txt to your home directory, you could enter cp /tmp/schedule.txt ~.
  • 17. mv  The mv command is used much like cp. However, it will copy the specified file to the new location in the file system and then delete the original.  For example, to move a file named mylog.txt from /tmp to /var/log, you would enter  mv /tmp/mylog.txt /var/log
  • 18. mv  The mv command is also used to rename files. Simply enter mv followed by the file to be renamed and then the new file name.  For example, to rename schedule.txt to schedule.old, you would enter mv schedule.txt schedule.old.