Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Filters in Linux

Rating
-
Sold
-
Pages
5
Uploaded on
31-05-2024
Written in
2023/2024

This guide describe types of filters in Linux and explain

Institution
Course

Content preview

Filters
standard input file, processes it, and sends .the
from the
fher is a program that takes input provides various filters,such as cat,grep, WC, tr, and
A
file. Linux
output tothe standard output
effectively withdata. Thenext section details the various filter
cut, t0 enable youto work
vaiable in Linux.

The grep Filter
specified pattern of characters and displays all the lines
The grep filter scarches a file for a searched for is referred to as a regular
pattern that is
chat contain the pattern. The specifying aregular expression.
pression. The grep filter cannot be used without
Syntax
(filename)
grep regular expression
in the grep command. If you do not specifya file name, the grep
The filename is optional are typing text, grep searches th
the standard input file. While you
filter expects input from specified expression. T
contains the
line for the regular expression and displays the line if it
and d keys.
stopthe execution of the grep filter, press the <Ctrl>
Example:
Sgrep job <Enter>
wori.
job
job
task
<Ctrl> d

In this example, the grep filter waits for input from the standard input file. The grep tiler
searches for the word job when you enter the words work, job,and task. When the grep

, Options of the grep Filter
command. The options
The grep filter offers options that enable you to alter the output of the
available with the grep filter are as follows:
-n:You can use this option with the grep filter todisplay each line matching the
specified pattern, along with the line number. The line number is printed at the
beginning of the line.
the
c:You can use this option to display only a count of the lines that match
specified pattern.
the specified
-v: Youcan use this option to display all the lines that do not match
pattern.
combine options while
You must specify the option before the regular expression. You can
the -nv option.
using the grep filter. For example, to combine the -n and -v options, you can use

The wc Filter
in a file. You can
The wc filter is used to count the number of lines, words, and characters
the
alsouse the wcfilter to count the nunmber of lines, words, and characters typed by using
standard input file.
Syntax
wc [-lwc) (filename/s J
Example
$wC sample <Enter>
2 7
29 sample
The file sample has 2 1ines,7 words, and 29 characters.

Written for

Institution
Course

Document information

Uploaded on
May 31, 2024
Number of pages
5
Written in
2023/2024
Type
SUMMARY

Subjects

$18.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
mythreyevenkatesan

Get to know the seller

Seller avatar
mythreyevenkatesan vellalar matriculation higher secondary school
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
20
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions