SlideShare a Scribd company logo
1 of 12
Mrs . Vijetha Bhat
 Pipe is a mechanism in which the output of one
command can be redirected as input to another
command.
 General format is,
Command1|command2
The output of command1 is sent to command2
as input.
Example:$ls |more
The output of the command ls is sent to the
more command as input.
The directory listing of the current directory is
displayed page by page.
The following two command group displays the total
number of users who are currently logged ion the
system.
$who > userlist.txt
Wc –l userlist.txt
 Redirection
Linux treats the keyboard as the standard input (value 0)
and terminal screen standard output (value 1) as well as
standard error(value2).
Redirection inputs:
The < symbol is used to redirect inputs.
Example
$cat < file.txt
File.txt takes input command cat.
Redirecting outptuts:
The > symbol is used to redirect outputs.
$ ls >list.doc
 Redirecting error messages:
The ‘2>’ symbol is used to redirect error messages.
Example :
$cat list1.doc
If there is no file named list1.doc in the current
directory then the error messages is sent to the
standard error device.
 Filters
There are some linux commands that accept input
from standard input or files,perform some
manipulation on it and produce some output to the
standard output.
Since these commands perform filtering operations
on data ,they are called as filters.
 Sort
This command sorts the contents of a given file based on
ASCII values of characters.
General format is,
Sort [options] <filename>
Where options can be,
-m <filelist> merges sorted files specified in <filelist>.
-o <filename> stores output in the specified
<filename>.
-r sorts the content in reverse order.
-u removes duplicate lines and displays sorted content.
-n numeric sort
Ggrep (global search for regular expression)command
is used to search specified pattern from a specified
file and displays those lines containing the pattern.
General format is,
Grep [options] pattern <filename>
Where options can be,
b ignores spaces ,tabs
I ignores distinction matching
V displays only the lines that do not match the
specified pattern.
C displays the total number of occurrence of the
pattern in the file.
N displays the resultant lines along with their line
numbers.
 Match zero or more characters.
Matches a single character.
[r1-r2] matches a single character within the ascii
range represented by the characters.
[^abcd] matches a single character which is not
a,b,c or d.
^<character>matches the lines that are beginning
with character specified in <character>.
 More command
The more command is used to display output page
by page.
More <filename>
Example:
$more a.c
This command will display the content of the file –
a.c page by page.
$ls | more
This command will display the directory listing
page by page.
 Pr
This command displays the contents of the specified
file adding with suitable header and footers.
The header part consist of last modified date and time
along with file name and page number.
General format is,
Pr [-options] <filename>
Where options can be,
-l it changes the page size to specified <number>
Of lines.
-<number> prepares the output in <number>columns.
-n numbers lines
-t turns off the heading at the to of the page.
Pipes and filters

More Related Content

What's hot

Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionarySoba Arjun
 
String Manipulation in Python
String Manipulation in PythonString Manipulation in Python
String Manipulation in PythonPooja B S
 
Linked lists in Data Structure
Linked lists in Data StructureLinked lists in Data Structure
Linked lists in Data StructureMuhazzab Chouhadry
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Muhammad Hammad Waseem
 
Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsShubham Sharma
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in pythoneShikshak
 
The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84Mahmoud Samir Fayed
 

What's hot (20)

Python Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, DictionaryPython Variable Types, List, Tuple, Dictionary
Python Variable Types, List, Tuple, Dictionary
 
String Manipulation in Python
String Manipulation in PythonString Manipulation in Python
String Manipulation in Python
 
Linked lists in Data Structure
Linked lists in Data StructureLinked lists in Data Structure
Linked lists in Data Structure
 
Dictionary
DictionaryDictionary
Dictionary
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || Algorithms
 
Text processing by Rj
Text processing by RjText processing by Rj
Text processing by Rj
 
CSE240 Doubly Linked Lists
CSE240 Doubly Linked ListsCSE240 Doubly Linked Lists
CSE240 Doubly Linked Lists
 
Data Structure (Circular Linked List)
Data Structure (Circular Linked List)Data Structure (Circular Linked List)
Data Structure (Circular Linked List)
 
Python Regular Expressions
Python Regular ExpressionsPython Regular Expressions
Python Regular Expressions
 
Linkedlist
LinkedlistLinkedlist
Linkedlist
 
Python : Functions
Python : FunctionsPython : Functions
Python : Functions
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
 
Singly linked list
Singly linked listSingly linked list
Singly linked list
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.2 book - Part 9 of 84
 
Unix Basic Commands
Unix Basic CommandsUnix Basic Commands
Unix Basic Commands
 
New features in Ruby 2.4
New features in Ruby 2.4New features in Ruby 2.4
New features in Ruby 2.4
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84
 
Python programming : Strings
Python programming : StringsPython programming : Strings
Python programming : Strings
 

Similar to Pipes and filters

Pipes and filters
Pipes and filtersPipes and filters
Pipes and filtersbhatvijetha
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptxHarsha Patel
 
Handling Files Under Unix.pptx
Handling Files Under Unix.pptxHandling Files Under Unix.pptx
Handling Files Under Unix.pptxHarsha Patel
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsMegha V
 
II BCA OS pipes and filters.pptx
II BCA OS pipes and filters.pptxII BCA OS pipes and filters.pptx
II BCA OS pipes and filters.pptxSavitha74
 
For this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxFor this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxalfred4lewis58146
 
Doscommands
DoscommandsDoscommands
DoscommandsDurgule
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling Ahmed El-Arabawy
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Functions in C++
Functions in C++Functions in C++
Functions in C++home
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i oroot_fibo
 
You are required to write an interactive C program that prompts the .pdf
You are required to write an interactive C program that prompts the .pdfYou are required to write an interactive C program that prompts the .pdf
You are required to write an interactive C program that prompts the .pdfarrowcomputers8700
 
Unit 8 text processing tools
Unit 8 text processing toolsUnit 8 text processing tools
Unit 8 text processing toolsroot_fibo
 
Functions in C++
Functions in C++Functions in C++
Functions in C++home
 

Similar to Pipes and filters (20)

Pipes and filters
Pipes and filtersPipes and filters
Pipes and filters
 
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
 
Unix Tutorial
Unix TutorialUnix Tutorial
Unix Tutorial
 
Python programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operationsPython programming: Anonymous functions, String operations
Python programming: Anonymous functions, String operations
 
Spsl II unit
Spsl   II unitSpsl   II unit
Spsl II unit
 
II BCA OS pipes and filters.pptx
II BCA OS pipes and filters.pptxII BCA OS pipes and filters.pptx
II BCA OS pipes and filters.pptx
 
For this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxFor this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docx
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Doscommands
DoscommandsDoscommands
Doscommands
 
Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling Course 102: Lecture 12: Basic Text Handling
Course 102: Lecture 12: Basic Text Handling
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Introduction to R for beginners
Introduction to R for beginnersIntroduction to R for beginners
Introduction to R for beginners
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i o
 
You are required to write an interactive C program that prompts the .pdf
You are required to write an interactive C program that prompts the .pdfYou are required to write an interactive C program that prompts the .pdf
You are required to write an interactive C program that prompts the .pdf
 
Perl Basics with Examples
Perl Basics with ExamplesPerl Basics with Examples
Perl Basics with Examples
 
Unit 8 text processing tools
Unit 8 text processing toolsUnit 8 text processing tools
Unit 8 text processing tools
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 

Pipes and filters

  • 2.  Pipe is a mechanism in which the output of one command can be redirected as input to another command.  General format is, Command1|command2 The output of command1 is sent to command2 as input. Example:$ls |more The output of the command ls is sent to the more command as input.
  • 3. The directory listing of the current directory is displayed page by page. The following two command group displays the total number of users who are currently logged ion the system. $who > userlist.txt Wc –l userlist.txt
  • 4.  Redirection Linux treats the keyboard as the standard input (value 0) and terminal screen standard output (value 1) as well as standard error(value2). Redirection inputs: The < symbol is used to redirect inputs. Example $cat < file.txt File.txt takes input command cat. Redirecting outptuts: The > symbol is used to redirect outputs. $ ls >list.doc
  • 5.  Redirecting error messages: The ‘2>’ symbol is used to redirect error messages. Example : $cat list1.doc If there is no file named list1.doc in the current directory then the error messages is sent to the standard error device.
  • 6.  Filters There are some linux commands that accept input from standard input or files,perform some manipulation on it and produce some output to the standard output. Since these commands perform filtering operations on data ,they are called as filters.
  • 7.  Sort This command sorts the contents of a given file based on ASCII values of characters. General format is, Sort [options] <filename> Where options can be, -m <filelist> merges sorted files specified in <filelist>. -o <filename> stores output in the specified <filename>. -r sorts the content in reverse order. -u removes duplicate lines and displays sorted content. -n numeric sort
  • 8. Ggrep (global search for regular expression)command is used to search specified pattern from a specified file and displays those lines containing the pattern. General format is, Grep [options] pattern <filename> Where options can be, b ignores spaces ,tabs I ignores distinction matching V displays only the lines that do not match the specified pattern. C displays the total number of occurrence of the pattern in the file. N displays the resultant lines along with their line numbers.
  • 9.  Match zero or more characters. Matches a single character. [r1-r2] matches a single character within the ascii range represented by the characters. [^abcd] matches a single character which is not a,b,c or d. ^<character>matches the lines that are beginning with character specified in <character>.
  • 10.  More command The more command is used to display output page by page. More <filename> Example: $more a.c This command will display the content of the file – a.c page by page. $ls | more This command will display the directory listing page by page.
  • 11.  Pr This command displays the contents of the specified file adding with suitable header and footers. The header part consist of last modified date and time along with file name and page number. General format is, Pr [-options] <filename> Where options can be, -l it changes the page size to specified <number> Of lines. -<number> prepares the output in <number>columns. -n numbers lines -t turns off the heading at the to of the page.