How do I match everything except certain characters using grep?
-
Example textfile used.
$ cat textfile If the boots fit boots bootss
We want to match everything but not the characters bots. The characters in red are the matches. The characters b, o, t, and s are not matched, everything else is.
$ grep -E "[^bots]" textfile If the boots fit bootsy was here
© Lightnetics 2024