SlideShare a Scribd company logo
2
Most read
4
Most read
Topic : Linux Files, Directories and Basic Commands
(Part- 1)
The cd command is used to change
the current directory.
Syntax:
cd <directory name>
cd .. is used to change the directory
one level up in our path.
Linux Files, Directories and Basic Commands
1. cd
The ls command is used to display a
list of the content of a directory.
Syntax:
ls
Linux Files, Directories and Basic Commands
2. ls
The cp command is used to copy a file or
directory.
Syntax:
cp <existing file name> <new file name>
Linux Files, Directories and Basic Commands
3. cp
The rm command is used to remove a
file.
Syntax:
rm <file name>
We can also delete only empty
directories using –d flag, otherwise
we only use rmdir to remove
directories.
Linux Files, Directories and Basic Commands
4. rm
The mkdir command is used to create
a new directory under any directory.
Syntax:
mkdir <directory name>
We can also create multiple directories
as shown in the figure if we name
multiple directories after the mkdir
command.
Linux Files, Directories and Basic Commands
5. mkdir
The rmdir command is used to delete
a directory.
Syntax:
rmdir <directory name>
We can also remove multiple
directories as shown in the figure if we
name multiple directories after the
rmdir command.
Linux Files, Directories and Basic Commands
6. rmdir
The pwd command is used to display
the location of the current working
directory.
Syntax:
pwd
Linux Files, Directories and Basic Commands
7. pwd
file command is used to determine
the type of a file.
Syntax:
file <option> <filename>
Linux Files, Directories and Basic Commands
8. file
The cat command prints the contents
of a specified file in the system’s
output.
Syntax:
cat <file name>
Linux Files, Directories and Basic Commands
9. cat
It works similarly as the cat command but
the more command displays screenful
output at a time in case of larger file (not
the whole content).
Syntax:
more <file name>
In more command, the following keys are used
to scroll the page:
1. ENTER key: To scroll down page by line.
2. Space bar: To move to the next page.
3. b key: To move to the previous page.
4. / key: To search the string.
Linux Files, Directories and Basic Commands
10. more
It works similarly as the more command
with some extra features such as
adjustment in width and height of the
terminal.
Syntax:
less <file name>
We have to press q to quit out of less.
Linux Files, Directories and Basic Commands
11. less
The chmod command is used to change the
access mode of a file.
Syntax:
chmod <options> <mode> <filename>
We can use the chmod command in 2
ways:
1. Symbol Mode:
Example: chmod u+rwx demo.txt
2. Operator Mode:
Example: chmod 755 demo.txt as in
figure.
Linux Files, Directories and Basic Commands
12. chmod
The chown command is used to change a file's
ownership, directory, or symbolic link for a user or
a group.
1. To change the owner:
sudo chown <username> <File name>
Example: sudo chown 1000 demo.txt as in the
figure.
2. To change owner and group:
sudo chown <username/UID> : <Groupname/GID>
<filename>
Example: sudo chown : shishir demo.txt as in figure.
Linux Files, Directories and Basic Commands
13. chown
ThankYou!!!

More Related Content

PDF
LinuxCommands (1).pdf
PPT
Linux commands
PPTX
Linux commands
DOCX
Linux basic commands tutorial
PPTX
various shell commands in unix operating system.pptx
PDF
linux commands.pdf
PPTX
Introduction to linux day1
PPTX
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
LinuxCommands (1).pdf
Linux commands
Linux commands
Linux basic commands tutorial
various shell commands in unix operating system.pptx
linux commands.pdf
Introduction to linux day1
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx

Similar to Lab 3 -Linux Files, Directories and Basic Commands.pptx (20)

PPT
linux-lecture4.ppt
PPTX
Basic Linux Commands and implementation with Examples
PPTX
Basic Linux Commands with syntax and functions
PPT
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
PPTX
Using linux in schools
PPT
Linux commands and file structure
PPTX
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
PPTX
Linux basics
PPT
Learning Linux v2.1
ODP
Linux commands
PPTX
Linux Commands all presentation file .pptx
PPTX
PDF
Basic linux commands
PPT
Common linux ubuntu commands overview
PDF
Linux_Commands.pdf
PPTX
Linux week 2
PDF
Basic unix commands
PPT
Basic Linux day 1
PPTX
Linux Command.pptx
PDF
basic-unix.pdf
linux-lecture4.ppt
Basic Linux Commands and implementation with Examples
Basic Linux Commands with syntax and functions
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
Using linux in schools
Linux commands and file structure
TERMINAL COMMANDS IN LINUX TERMINAL USED TO INTERACT WITH SYSTEM
Linux basics
Learning Linux v2.1
Linux commands
Linux Commands all presentation file .pptx
Basic linux commands
Common linux ubuntu commands overview
Linux_Commands.pdf
Linux week 2
Basic unix commands
Basic Linux day 1
Linux Command.pptx
basic-unix.pdf
Ad

More from Ciceer Ghimirey (7)

PPTX
Classification-Support Vector Machines.pptx
PPTX
Machine Vision Concepts ,Application & Components.pptx
PPTX
Lab 5 Linux File Structure and Hierarchy.pptx
PPTX
Install Linux OS in Virtual Box.pptx
PPTX
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptx
PPTX
Complete WordPress Setup (Description about Themes & Plugins Added)
PPTX
WordPress Introduction and WordPress Theme Installation Slides
Classification-Support Vector Machines.pptx
Machine Vision Concepts ,Application & Components.pptx
Lab 5 Linux File Structure and Hierarchy.pptx
Install Linux OS in Virtual Box.pptx
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptx
Complete WordPress Setup (Description about Themes & Plugins Added)
WordPress Introduction and WordPress Theme Installation Slides
Ad

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
Building Integrated photovoltaic BIPV_UPV.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Lab 3 -Linux Files, Directories and Basic Commands.pptx

  • 1. Topic : Linux Files, Directories and Basic Commands (Part- 1)
  • 2. The cd command is used to change the current directory. Syntax: cd <directory name> cd .. is used to change the directory one level up in our path. Linux Files, Directories and Basic Commands 1. cd
  • 3. The ls command is used to display a list of the content of a directory. Syntax: ls Linux Files, Directories and Basic Commands 2. ls
  • 4. The cp command is used to copy a file or directory. Syntax: cp <existing file name> <new file name> Linux Files, Directories and Basic Commands 3. cp
  • 5. The rm command is used to remove a file. Syntax: rm <file name> We can also delete only empty directories using –d flag, otherwise we only use rmdir to remove directories. Linux Files, Directories and Basic Commands 4. rm
  • 6. The mkdir command is used to create a new directory under any directory. Syntax: mkdir <directory name> We can also create multiple directories as shown in the figure if we name multiple directories after the mkdir command. Linux Files, Directories and Basic Commands 5. mkdir
  • 7. The rmdir command is used to delete a directory. Syntax: rmdir <directory name> We can also remove multiple directories as shown in the figure if we name multiple directories after the rmdir command. Linux Files, Directories and Basic Commands 6. rmdir
  • 8. The pwd command is used to display the location of the current working directory. Syntax: pwd Linux Files, Directories and Basic Commands 7. pwd
  • 9. file command is used to determine the type of a file. Syntax: file <option> <filename> Linux Files, Directories and Basic Commands 8. file
  • 10. The cat command prints the contents of a specified file in the system’s output. Syntax: cat <file name> Linux Files, Directories and Basic Commands 9. cat
  • 11. It works similarly as the cat command but the more command displays screenful output at a time in case of larger file (not the whole content). Syntax: more <file name> In more command, the following keys are used to scroll the page: 1. ENTER key: To scroll down page by line. 2. Space bar: To move to the next page. 3. b key: To move to the previous page. 4. / key: To search the string. Linux Files, Directories and Basic Commands 10. more
  • 12. It works similarly as the more command with some extra features such as adjustment in width and height of the terminal. Syntax: less <file name> We have to press q to quit out of less. Linux Files, Directories and Basic Commands 11. less
  • 13. The chmod command is used to change the access mode of a file. Syntax: chmod <options> <mode> <filename> We can use the chmod command in 2 ways: 1. Symbol Mode: Example: chmod u+rwx demo.txt 2. Operator Mode: Example: chmod 755 demo.txt as in figure. Linux Files, Directories and Basic Commands 12. chmod
  • 14. The chown command is used to change a file's ownership, directory, or symbolic link for a user or a group. 1. To change the owner: sudo chown <username> <File name> Example: sudo chown 1000 demo.txt as in the figure. 2. To change owner and group: sudo chown <username/UID> : <Groupname/GID> <filename> Example: sudo chown : shishir demo.txt as in figure. Linux Files, Directories and Basic Commands 13. chown