SlideShare a Scribd company logo
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 (11)

PPTX
Linux commands part4
bhatvijetha
 
PDF
Basic linux commands
Shakeel Shafiq
 
PPTX
Basic unix commands
swtjerin4u
 
PPTX
Linux Basic commands and VI Editor
shanmuga rajan
 
PDF
Vi Editor
Shiwang Kalkhanda
 
ODP
Linux commd
ragav03
 
ODP
Linux commd
ragav03
 
PPT
Basic command ppt
Rohit Kumar
 
PPTX
Unix slideshare
Mohan Krishna Kona
 
PDF
Basic linux commands
Raghav Arora
 
DOCX
40 basic linux command
Teja Bheemanapally
 
Linux commands part4
bhatvijetha
 
Basic linux commands
Shakeel Shafiq
 
Basic unix commands
swtjerin4u
 
Linux Basic commands and VI Editor
shanmuga rajan
 
Linux commd
ragav03
 
Linux commd
ragav03
 
Basic command ppt
Rohit Kumar
 
Unix slideshare
Mohan Krishna Kona
 
Basic linux commands
Raghav Arora
 
40 basic linux command
Teja Bheemanapally
 

Similar to Linux commands part -2 (20)

PPTX
Rishav Mishra final presentation on UNIX Final.pptx
rishavmishra041
 
DOCX
40 basic linux command
Teja Bheemanapally
 
PDF
Linux file commands and shell scripts
PrashantTechment
 
PPTX
File Commands - R.D.Sivakumar
Sivakumar R D .
 
PPTX
linux chapter 5.pptx lesson About introduction to linux
zakiaxmed534
 
DOCX
Chapter 4 Linux Basic Commands
Shankar Mahure
 
PDF
2023comp90024_linux2.pdf
LevLafayette1
 
PPT
2.Utilities.ppt
SupunAsanga2
 
PPTX
Basics of Unix Adminisration
Venkateswarlu Malleboina
 
PPTX
Unix Linux Commands Presentation 2013
Wave Digitech
 
PPTX
Linux System commands Essentialsand Basics.pptx
mba1130feb2024
 
PPT
Linux commands
Meenu Chopra
 
PPT
Linux commands and file structure
Sreenatha Reddy K R
 
PPT
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
PPTX
Introduction to linux day1
UtpalenduChakrobortt1
 
PPT
linux-lecture4.ppt
LuigysToro
 
PDF
Cp command in Linux
Syed SadathUllah
 
PPTX
Handling Files Under Unix.pptx
Harsha Patil
 
PPTX
Handling Files Under Unix.pptx
Harsha Patil
 
Rishav Mishra final presentation on UNIX Final.pptx
rishavmishra041
 
40 basic linux command
Teja Bheemanapally
 
Linux file commands and shell scripts
PrashantTechment
 
File Commands - R.D.Sivakumar
Sivakumar R D .
 
linux chapter 5.pptx lesson About introduction to linux
zakiaxmed534
 
Chapter 4 Linux Basic Commands
Shankar Mahure
 
2023comp90024_linux2.pdf
LevLafayette1
 
2.Utilities.ppt
SupunAsanga2
 
Basics of Unix Adminisration
Venkateswarlu Malleboina
 
Unix Linux Commands Presentation 2013
Wave Digitech
 
Linux System commands Essentialsand Basics.pptx
mba1130feb2024
 
Linux commands
Meenu Chopra
 
Linux commands and file structure
Sreenatha Reddy K R
 
linux-lecture4.pptuyhbjhbiibihbiuhbbihbi
YajnadattaPattanayak
 
Introduction to linux day1
UtpalenduChakrobortt1
 
linux-lecture4.ppt
LuigysToro
 
Cp command in Linux
Syed SadathUllah
 
Handling Files Under Unix.pptx
Harsha Patil
 
Handling Files Under Unix.pptx
Harsha Patil
 
Ad

More from bhatvijetha (6)

PPTX
LINUX:Control statements in shell programming
bhatvijetha
 
PPT
Shellvariables in Linux
bhatvijetha
 
PPTX
Vi editor
bhatvijetha
 
PPTX
Unix vs linux
bhatvijetha
 
PPTX
Pipes and filters
bhatvijetha
 
PPTX
Introduction to unix
bhatvijetha
 
LINUX:Control statements in shell programming
bhatvijetha
 
Shellvariables in Linux
bhatvijetha
 
Vi editor
bhatvijetha
 
Unix vs linux
bhatvijetha
 
Pipes and filters
bhatvijetha
 
Introduction to unix
bhatvijetha
 
Ad

Recently uploaded (20)

PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
Presentation: Climate Citizenship Digital Education
Karl Donert
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
PPTX
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
Presentation: Climate Citizenship Digital Education
Karl Donert
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Optimizing Cancer Screening With MCED Technologies: From Science to Practical...
i3 Health
 
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
Nutri-QUIZ-Bee-Elementary.pptx...................
ferdinandsanbuenaven
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Capitol Doctoral Presentation -July 2025.pptx
CapitolTechU
 

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