Linux Command Line (36) grep

MichaelsTechTutorials
MichaelsTechTutorials
5.1 هزار بار بازدید - 3 سال پیش - In the early days of
In the early days of Unix grep stood for Global Regular Expression Print

We use grep to find regular expressions (also known as regex) text strings in a file.

The entire line that contains the regular expression is returned.

Grep is case sensitive (that we can turn off with the -i option) and can return lines containing the regex as a word (with white-space characters on both sides of the regex)

We then add the -n option to grep show the line numbers our regex is found and we can also grep the inverse  (meaning show all the lines in the file except the lines the regex is found on) by using the -v option.

We can grep the count the number of times our regex is found with the -c option

We also look at how to pipe text into grep with ls -lh | grep '2019'

See the complete LCL playlist at: Linux Command Line  (01) What Is The ...

Website link:
https://thefrugalcomputerguy.com/linu...
3 سال پیش در تاریخ 1399/12/30 منتشر شده است.
5,133 بـار بازدید شده
... بیشتر