Linux Commands Tutorial - Regular Expression basics

preview_player
Показать описание
A tutorial on how to use Regular Expressions for egrep & sed to filter and modify text file content.

This tutorial covers commands like:
egrep, sed

Twitter: @lambdastartup
Рекомендации по теме
Комментарии
Автор

Just watched the whole video. Helped me a lot in preparations for an exam. Thanks!

Brejdaczki
Автор

Nice tutorial!
Couple of notes:
egrep does not need -E, only grep does. ;)
you can give sed more commands without the -e switch by delimiting them with a semicolon ;

GoranObal
Автор

Another thing I found that may have changed over the time is that:
Such syntax doesn't work anymore: sed 's/[0-9]/NOTE:\1/g' File
You can change that with: sed 's/[0-9]/NOTE:&/g' File
"&" being the Pattern you replace with sed. In this case numbers [0-9].

Brejdaczki
Автор

Thank you very much for uploading. This was extremely enlightening.

rasmus
Автор

I think its great content delivered with quite a bit of ease, thanks. Do upload more.

umersaeed
Автор

'^aa|bb$' is equal to '(^aa|bb$)' instead of '^a(a|b)b$'

nnd
Автор

I have a doubt.At 23:03 He says its combination of 'a' and 'b', but '[ab]' indicates either a or b .Then how come a line that has 'abab' got printed on screen.As there are neither 3 'a's nor 3 'b's .Please clear this as it has bugged my head :D

srinivaskulkarni
Автор

Thank you man, your explanation was very clear and help me understand it

jesusalfonso
Автор

Guys, is there anyone who could help me to find the mistake?

Based on the information from the video i am trying to create a template to be able to see the lines like this:
Anna Hays 4, 5, 4, 3.5, 2, 5, 4, 5
My command here \\\ egrep -iE '[a-z]+\ [a-z]+\ (2|3|3\.5|4|4\.5|5|, )+$' /// does not work once as i add $ sign at the end.
However, if i delete this sign - the sense of filtering disappears as it is enough that numbers from the range only shows ones and should not last till the end.

The funniest thing is that even if i just filter lie this \\\ egrep -E '5$' /// line does not show up!

I would appreciate all the advices as i've tried all my assumptions. :)

WarmShiningAir
Автор

quick comment, don't sigh so much. you made me sleepy just listening to the vid. Good explanantion tho

joshuahwang
Автор

I don't get why use egrep? You said it's for regular expressions but that is literally what the re in grep stand for; "global regular expression print"

paxdriver
Автор

should have taken better example :) little confusing

rajeevs
Автор

Bro, nice explanation but you need to teach a little faster

saltyreese
visit shbcf.ru