3 ms·
don't forget grep -v: "-v, --invert-match"
by skrtskrt 5y ago
don't forget grep -v:
"-v, --invert-match"
- distortedsignal 5y agoThis one is actually really interesting! I would guess that it comes from electrical engineering, and specifically the signal processing side of things where filters happen. One option for filters are “notch filters” [1], and the letter “v” looks like a notch. So just think of “notching-out” a signal when you’re trying to remove something from your grip results. [1] https://en.wikipedia.org/wiki/Band-stop_filter https://en.wikipedia.org/wiki/Band-stop_filter
- Brian_K_White 5y agoMight just be that i was taken for case insensitive. 62 characters is not a lot for tools that have a lot of settings. In the case of tools like grep, the settings are really more of a command vocabulary, and should rightly be written in their own language in a script file, like sed and awk, but grep makes some especially commonly needed ops available as a simpler command with switches for convenience. And that results in some seemingly arcane and inconsistent commandlines. Defining how to search for something is just not a simple 2 or 3 options covers it kind of job. By contrast, another tool with the same problem but clearly originated from a different starting idea is 'find'. It also has to have essentially a vocabulary to express your intentions in composed sentences, and it ends up with a mix of switches and words.
- saghm 5y agoI'd guess that it's probably just that `-i` and `-n` were used for other options, and `-v` is the next letter and a fairly prominent sound in the word.
- cpu 5y agoPerhaps it was simply an available letter, as saghm said, but I've always imagined that at least part of the origin story is that it's a mnemonic for "invert" or "negative".