Posts

Showing posts with the label grep

grep command usage examples.

Image
grep is one of the most widely and frequently used command by linux administrators for their day to day work. Be it finding a specific line among thousands of lines in a code orsearching a log file for errors and warnings, we depend on grep. Following are some examples on typical usages of grep command.

How to print lines matching pattern or string ?

Image
Consider you have a file called dictionary.txt with a huge collection of words and you only want to view line containing the word "tux". To check each word line by line is a tedious task, instead we use the grep command.