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...
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.
…
- Starting grep pattern.
- Stopping grep pattern.
- File path.
30 апр. 2014 г.
How do I grep a specific line number in Unix?
How it works
- First, we use -n option to add line numbers before each line. We want to numerate all the lines we we are matching . …
- Then we are using extended regular expressions so we can use | special character which works as OR.
12 сент. 2012 г.