Skip to main content

Using Grep

By October 30, 2017September 12th, 2022No Comments


Using grepIn this eGuide to using grep, Andrew Mallett, The Urban Penguin takes you through 20 pages of explanations and examples on this fabulous tool. Being able to quickly filter text at the command line is something a devop or administrator will need daily. No matter if you need to filter text from a file or, as often is needed, the output of a command this guide will help you. You can count this as one of you command line tools that you must know. Working through the guide from The Urban Penguin you will also see that using grep allows you to quickly solve crossword puzzles too, yes a crossword puzzle solver, what more could you ask for?

Yes, really, learning to use grep and regular expressions is easily implemented against the dictionary file that ships with Linux. We will be using Ubuntu 16.04 and many grep options and not only showing how to use them but why they are important. You will learn to display matches only with -o and to search for words with -w. We don’t stop with grep either we take you through a regular expression tutorial to see how you can easily tame the dreaded regular expression libraries when using grep. The guide is downloadable as a PDF without DRM, but please use respectfully, and is your for just £0.99 payable via PayPal. I am sure that you will not be disappointed and will find this comprehensive guide useful. Download the guide now

  • Option -F = fgrep
  • Option -r = rgrep
  • Option -E = egrep
  • Option -P = pgrep
  • Option -o =  show matches only
  • Option -w = word search
  • Option -c = count matching lines
  • Option -C = Show lines above and below
  • Option -A =  Show lines after
  • Option -B = Show lines before
  • Option -l = list filenames only

You may also like my guide to LVM in Linux