skip to content
Alvin Lucillo

Invert match with grep

/ 1 min read

To invert the match (i.e., show those that don’t match the given express), use -v. In the example below, it shows everything in the current directory except for package.json

ls | grep -v package.json