Quantcast
Channel: aix
Viewing all articles
Browse latest Browse all 10

grep reverse: how to reverse the meaning of a `grep` search

$
0
0

grep reverse: how to reverse the meaning of a `grep` search

Problem

You need to reverse the meaning of a search you're performing with the grep command. For instance, you've been searching for pepperoni pizza orders like this:

grep pepperoni pizza-orders.txt

and now you need to find all orders that don't have pepperoni.

Solution

Just add the -v switch to your grep search command, like this:


Viewing all articles
Browse latest Browse all 10

Trending Articles