This tutorial explains pipes, grep and sort commands with examples.

Click on the time points below to view different sections!

0:07 What are Pipes in Linux?
1:12 ‘pg’ and ‘More’ commands with example
1:38 The ‘grep’ Command with example
3:05 The ‘sort’ Command with example
5:23 Summary

What is a Pipe in Linux?
The Pipe is a command in Linux that lets you use two or more commands such that output of one command serves as input to the next. The symbol is ‘|’

What is grep in Linux?
If you want to search a particular information the postal code from a text file you can use grep command on command line.
Syntax – grep search_string

What is sort command in Linux?
This command helps in sorting out the contents of a file alphabetically.
Syntax – sort Filename

Like, share and subscribe our channel for more videos.
Watch more videos on our YouTube channel at
READ this as a book on Amazon by viewing at
Visit our website for more! www.guru99.com
Read our blogs in
FACEBOOK! Would you prefer to watch more about us? Like our page for more
TWITTER! Tweet for us on Twitter with #guru99 and follow us on
LinkedIn! Follow us here

THANKS! We appreciate you reading this and hope you have a wonderful day!

Sincerely,
Guru99

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

31 Comments

Guru99

April 21, 2020

Check out COMPLETE LinuxTutorials: https://www.youtube.com/playlist?list=PLckPQEKYlbxebubMWdjcGR7K_ukm35ZjN

Reply

MES refael

April 21, 2020

1:29
The "pg" command is not exist in Terminal

Reply

Vivek Subramanian

April 21, 2020

Nice video, but you can just say "grep" instead of "the G-R-E-P command" every time…

Reply

Faz

April 21, 2020

G r e p? 😂

Reply

Ma Dee

April 21, 2020

HUGE THANK YOU!!!

Reply

raytry69

April 21, 2020

To be exact, the -i is for "–ignore-case: Ignore case distinctions in both the PATTERN and the input files."

Reply

Paul Morrey

April 21, 2020

Thanks

Reply

shraddha chavan

April 21, 2020

Can u plz explain how to use find

Reply

Jazzy G

April 21, 2020

Thanks a bunch!!!! Was having trouble using multiple commands with pipelines specifically: cat fruits | grep -v a | sort -r

Reply

VariableStromtarife

April 21, 2020

Useless use of cat

Reply

Raj y

April 21, 2020

Super bro nice explanation

Reply

johnNYgoesLA

April 21, 2020

I needed to learn about grep, I came back for the music <3

Reply

krishna shakya

April 21, 2020

Amazing i love it !!

Reply

ruell black

April 21, 2020

The music is extremely bothersome.

Reply

ahmed alali

April 21, 2020

Really amazing and short video.

Reply

Vipul Beriwal

April 21, 2020

error and fruits are the random files. I am trying to redirect the lines which do not contain small 'a' and want to sort if in reverse order. However, the command is not working

NOT WORKING – cat fruits | grep -v a > error | sort -r error
WORKING – cat fruits | grep -v a | sort -r > error

WHY ?? @GURU99

Reply

My Garden

April 21, 2020

Your tutorial is good but please remove the music which is not letting me to put concentration on the tutorial, Tnx

Reply

Bodyskillz2011

April 21, 2020

the grep command can display the results too without the cat command

Reply

shizyninjarocks

April 21, 2020

AWESOME BACKGROUND MUSIC

Reply

Patrick Williams

April 21, 2020

The cat command in this tutorial is initially used to see the contents of the fruits file and the subsequent change to it's output as it passes through grep via a pipe. grep "Avocado" fruits or "fruits" is the syntax if you are in the same directory as the fruits file otherwise it is grep "Avocado" "/path/to/fruits file" if you are not.

Reply

cornlow

April 21, 2020

Very clear and simple. I like the your style in explaining the subject.

Reply

footb 4all

April 21, 2020

Very good.Keep up such a simple explanations.You just owned subscriber and like 🙂

Reply

Rene Thomas

April 21, 2020

A very clear and well-presented lesson

Reply

ronin2167

April 21, 2020

Why use the cat with grep? Couldn't you just grep the file. grep "Avocado" /fruits

Reply

Parminder singh

April 21, 2020

occult music

Reply

Amir Sepasi

April 21, 2020

turn off the stupid background music

Reply

Daniela Barrientos

April 21, 2020

Hi, does anyone know a detailed explanation online for the use of pipes in Linux? 🙂

Reply

Trent Armstrong

April 21, 2020

Thank you!  Very concise, with just the necessary information.  But please turn the music down.  

Reply

MJ C.

April 21, 2020

Hello Guru, it's amazing tutorial. Thanks

Reply

Channel Ten two

April 21, 2020

very good except the very annoying loud background music. I cant see the point in music while trying to learn something. maybe turn it down to a minimum. otherwise thumbs up for all the linux videos

Reply

Quarker

April 21, 2020

omg just say GREP lol

Reply

Leave a Reply