SlideShare a Scribd company logo
1 of 31
PIPES AND FILTERS
Pipe
 Pipe is a mechanism in which output of one
command can be redirected as input to
another command.
 General format
Command 1|Command 2
Output of one command 1 is sent to input of
command2
Example
 $ who > userlist.txt
 $ wc –l userlist.txt
If we use pipe mechanism then there is no
need to create temporary file.
$ who | wc -l
REDIRECTION:
 Linux treats the keyboard as the standard input
(value 0) and terminal screen as standard output
(value 1) as well as standard error (value 2).
 We can also take input from sources other than
the keyboard and output can be passed to any
source other than the terminal screen. Such a
process is called as “redirection”.
REDIRECTION:
 The ‘<’ symbol is used to redirect inputs,
the ‘>’ symbol is used to redirect outputs
and ‘2>’ symbol is used to redirect error
messages.
 $ cat < file1.txt
 $ ls > list.doc
 $ cat list1.doc 2> errormes.txt
FILTERS:
 There are some Linux commands that
accept input from standard input or files,
perform some manipulation on it, and
produces some output to the standard
output. These are called as “filters”.

Sort –r <filename>
Sort –m <filename>
Sort –n<filename>
grep filter
 The grep filter searches a file for a particular
pattern of characters, and displays all lines
that contain that pattern.
 (grep stands for globally search for regular
expression and print out).
 General format
grep [options] pattern [files]
grep -v
grep -i
Regular expression character set
more
 If the information to be displayed on the screen is
very long, it scrolls up on the screen fastly. So, the
user cannot be able to read it.
 This more command is used to display the output page
by page (without scrolling up on the screen fastly).
 Use [spacebar] or [f] key to scroll forward one
screen, use [b] key to scroll backward one screen, use
[q] key to quit displaying.
more
cut
paste
 This command concatenate the content of
the specified file into single file vertically.
 Cut command separates the columns paste
command merges the column.
 General format
paste <filename1><filename2>...
tr
 This command is used to change the case
of alphabet
 General format
<tr> <Characterset1><Characterset2><Standard Input>
tr

More Related Content

Similar to II BCA OS pipes and filters.pptx

Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
Bui Van Cuong
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
Reka
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i o
root_fibo
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables
Gautam Raja
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Sudharsan S
 

Similar to II BCA OS pipes and filters.pptx (20)

Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands
 
Linux
LinuxLinux
Linux
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Unix day3 v1.3
Unix day3 v1.3Unix day3 v1.3
Unix day3 v1.3
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
 
Linux
LinuxLinux
Linux
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i o
 
Ch05
Ch05Ch05
Ch05
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .ppt
 
Group13
Group13Group13
Group13
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Linux
LinuxLinux
Linux
 
3. intro
3. intro3. intro
3. intro
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
 

Recently uploaded

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

II BCA OS pipes and filters.pptx

  • 2. Pipe  Pipe is a mechanism in which output of one command can be redirected as input to another command.  General format Command 1|Command 2 Output of one command 1 is sent to input of command2
  • 3. Example  $ who > userlist.txt  $ wc –l userlist.txt If we use pipe mechanism then there is no need to create temporary file. $ who | wc -l
  • 4. REDIRECTION:  Linux treats the keyboard as the standard input (value 0) and terminal screen as standard output (value 1) as well as standard error (value 2).  We can also take input from sources other than the keyboard and output can be passed to any source other than the terminal screen. Such a process is called as “redirection”.
  • 5. REDIRECTION:  The ‘<’ symbol is used to redirect inputs, the ‘>’ symbol is used to redirect outputs and ‘2>’ symbol is used to redirect error messages.
  • 6.  $ cat < file1.txt  $ ls > list.doc  $ cat list1.doc 2> errormes.txt
  • 7. FILTERS:  There are some Linux commands that accept input from standard input or files, perform some manipulation on it, and produces some output to the standard output. These are called as “filters”. 
  • 8.
  • 9.
  • 11.
  • 13.
  • 15. grep filter  The grep filter searches a file for a particular pattern of characters, and displays all lines that contain that pattern.  (grep stands for globally search for regular expression and print out).  General format grep [options] pattern [files]
  • 16.
  • 17.
  • 20.
  • 22.
  • 23. more  If the information to be displayed on the screen is very long, it scrolls up on the screen fastly. So, the user cannot be able to read it.  This more command is used to display the output page by page (without scrolling up on the screen fastly).  Use [spacebar] or [f] key to scroll forward one screen, use [b] key to scroll backward one screen, use [q] key to quit displaying.
  • 24. more
  • 25. cut
  • 26.
  • 27.
  • 28. paste  This command concatenate the content of the specified file into single file vertically.  Cut command separates the columns paste command merges the column.  General format paste <filename1><filename2>...
  • 29.
  • 30. tr  This command is used to change the case of alphabet  General format <tr> <Characterset1><Characterset2><Standard Input>
  • 31. tr