Frequent Question: How Do I Grep a Particular Line in Unix?
Contents

How do I grep a specific line in Linux?

You don’t need to run grep followed by sed . which deletes all lines from the first matched line to the last match, including those lines. Use sed -n with “p” instead of “d” to print those lines instead.
…

  1. Starting grep pattern.
  2. Stopping grep pattern.
  3. File path.

30 апр. 2014 г.

How do I grep a specific line number in Unix?

How it works

  1. First, we use -n option to add line numbers before each line. We want to numerate all the lines we we are matching . …
  2. Then we are using extended regular expressions so we can use | special character which works as OR.

12 сент. 2012 г.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest