SlideShare a Scribd company logo
1 of 13
LINUX :FILE ORIENTED
COMMANDS
1bhatvijetha
 Cat
This cat (catenated –concatenate) command is used
to display the contents of the specified file.
General format :
Cat [-options] <filename1> [<filename2>…]
Where options can be,
S suppresses warning about non-existing files.
d lists the sub-directory entries only
b numbers non blank output lines
n numbers all output lines
2bhatvijetha
 Example
$cat a.c
This will display the contents of the file , a.c
$cat a.c b.c
This will display the contents of the files a.c and b.c one by
one.
3bhatvijetha
 Cp
This cp command is used to copy the content of on file into
another file .
If the destination is an existing file,the file is overwritten ;
If the destination is an existing directory ,the file is copied
into that directory.
General format is,
Cp [-options] <source file > <destination file>
4bhatvijetha
 rm
The rm (remove )command is used to remove a file from
the specified directory.
To remove a file you must have a write permission for the
directory that contains the file but you need not have
permission on the file itself.
General format is,
Rm [-options] <filename>
Where options can be,
r deletes all directories including the lower order directories.
I prompts before deleting
f removes write protected files also,without prompting.
5bhatvijetha
 Example
$ rm a.c
This command deletes the file a.c from the current
directory.
6bhatvijetha
Mv
This command is used to rename the specified
files/directories.
General format is,
Mv <source> <destination>
For move command the user must have both write and
execute permissions on the source.
Example:
$mv a.c b.c
Then file a.c is renamed as b.c.
7bhatvijetha
 Wc
This command is used to display the number of lines words
and characters of information stored in a specified file.
General format is,
Wc [-options] <filename>
Where options can be,
l displays the number of lines in the file
W displays the number of words in the file
C displays the number of characters in the file
Examples:
$ wc a.c
It displays the number of lines, words and characters in the
file.
8bhatvijetha
 Cmp
This cmp command is used to compare two files.
General format is,
Cmp <filename1><filename2>
This command reports the first instants of differences
between the specified files.
that is the two files are compared byte by byte and the
location of first mismatch is echoed to the screen.
9bhatvijetha
File access permissions
 There are 3 types of file in linux.
 Ordinary file
 Directory file
 Special file(device file)
The ordinary file consist of a stream of data that are stored
on some magnetic media.
A directory doesnot contain any data but keeps track o
account of all file and sudirectories that it contains.
Linux treats even physical devices as files.such files are
called as special files.
10bhatvijetha
 There are 3 types of modes for accessing thes files as
follows,
Read mode
Write mode
Execute mode
The file permission is displayed in 10 characters.
Bit position: 1 234 567 8910
Meaning:file/directory rwx permission rwx permission rwx permission
for users usergroup others
r readable
w writeable
X executable
- Denial of permission
11bhatvijetha
 Touch command
This command is used to create a new empty file.
The length of the file created is zero.
 Head command
The head command is used to display few lines at the
beginning of one or more files.
This is used in verifying the contents of a file.
By default it displays the first 10 lines of a file.
The general syntax of this command is
$head[count option] filename[s].
12bhatvijetha
Remaining commands Continued …in part3
presentation
13bhatvijetha

More Related Content

What's hot

What's hot (11)

Linux commands part4
Linux commands part4Linux commands part4
Linux commands part4
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Linux commd
Linux commdLinux commd
Linux commd
 
Linux commd
Linux commdLinux commd
Linux commd
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 

Similar to Linux commands part -2

Similar to Linux commands part -2 (20)

40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
File Commands - R.D.Sivakumar
File Commands - R.D.SivakumarFile Commands - R.D.Sivakumar
File Commands - R.D.Sivakumar
 
Chapter 4 Linux Basic Commands
Chapter 4 Linux Basic CommandsChapter 4 Linux Basic Commands
Chapter 4 Linux Basic Commands
 
2023comp90024_linux2.pdf
2023comp90024_linux2.pdf2023comp90024_linux2.pdf
2023comp90024_linux2.pdf
 
2.Utilities.ppt
2.Utilities.ppt2.Utilities.ppt
2.Utilities.ppt
 
Basics of Unix Adminisration
Basics  of Unix AdminisrationBasics  of Unix Adminisration
Basics of Unix Adminisration
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Cp command in Linux
Cp command in LinuxCp command in Linux
Cp command in Linux
 
Lnx
LnxLnx
Lnx
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptx
 
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
 
QSpiders - Unix Operating Systems and Commands
QSpiders - Unix Operating Systems  and CommandsQSpiders - Unix Operating Systems  and Commands
QSpiders - Unix Operating Systems and Commands
 
Basiccommandppt 130415133716-phpapp02
Basiccommandppt 130415133716-phpapp02Basiccommandppt 130415133716-phpapp02
Basiccommandppt 130415133716-phpapp02
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 

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

_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
 
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
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
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
 
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
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
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
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
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
 
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
 

Recently uploaded (20)

_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
 
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
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
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
 
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
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
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
 
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
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
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
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
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
 

Linux commands part -2

  • 2.  Cat This cat (catenated –concatenate) command is used to display the contents of the specified file. General format : Cat [-options] <filename1> [<filename2>…] Where options can be, S suppresses warning about non-existing files. d lists the sub-directory entries only b numbers non blank output lines n numbers all output lines 2bhatvijetha
  • 3.  Example $cat a.c This will display the contents of the file , a.c $cat a.c b.c This will display the contents of the files a.c and b.c one by one. 3bhatvijetha
  • 4.  Cp This cp command is used to copy the content of on file into another file . If the destination is an existing file,the file is overwritten ; If the destination is an existing directory ,the file is copied into that directory. General format is, Cp [-options] <source file > <destination file> 4bhatvijetha
  • 5.  rm The rm (remove )command is used to remove a file from the specified directory. To remove a file you must have a write permission for the directory that contains the file but you need not have permission on the file itself. General format is, Rm [-options] <filename> Where options can be, r deletes all directories including the lower order directories. I prompts before deleting f removes write protected files also,without prompting. 5bhatvijetha
  • 6.  Example $ rm a.c This command deletes the file a.c from the current directory. 6bhatvijetha
  • 7. Mv This command is used to rename the specified files/directories. General format is, Mv <source> <destination> For move command the user must have both write and execute permissions on the source. Example: $mv a.c b.c Then file a.c is renamed as b.c. 7bhatvijetha
  • 8.  Wc This command is used to display the number of lines words and characters of information stored in a specified file. General format is, Wc [-options] <filename> Where options can be, l displays the number of lines in the file W displays the number of words in the file C displays the number of characters in the file Examples: $ wc a.c It displays the number of lines, words and characters in the file. 8bhatvijetha
  • 9.  Cmp This cmp command is used to compare two files. General format is, Cmp <filename1><filename2> This command reports the first instants of differences between the specified files. that is the two files are compared byte by byte and the location of first mismatch is echoed to the screen. 9bhatvijetha
  • 10. File access permissions  There are 3 types of file in linux.  Ordinary file  Directory file  Special file(device file) The ordinary file consist of a stream of data that are stored on some magnetic media. A directory doesnot contain any data but keeps track o account of all file and sudirectories that it contains. Linux treats even physical devices as files.such files are called as special files. 10bhatvijetha
  • 11.  There are 3 types of modes for accessing thes files as follows, Read mode Write mode Execute mode The file permission is displayed in 10 characters. Bit position: 1 234 567 8910 Meaning:file/directory rwx permission rwx permission rwx permission for users usergroup others r readable w writeable X executable - Denial of permission 11bhatvijetha
  • 12.  Touch command This command is used to create a new empty file. The length of the file created is zero.  Head command The head command is used to display few lines at the beginning of one or more files. This is used in verifying the contents of a file. By default it displays the first 10 lines of a file. The general syntax of this command is $head[count option] filename[s]. 12bhatvijetha
  • 13. Remaining commands Continued …in part3 presentation 13bhatvijetha