The day to day usage is:
grep -rIn pattern directory
There are some files that I want to avoid, they are in directories that have this kind of path in them at some point:
app/lib/bower/lodash
, app/lib/bower/paho-mqtt-js
, app/lib/bower/socket-io-client
.
Ideal solution is to detect app/lib/bower/
in the path, but it's hard. Is it possible?
I've come up with:
alias grep='grep --exclude-dir={lodash,paho-mqtt-js,socket-io-client}'
Good enough (though needs maintenance when new stuff is added). How to at least add a short warning into stderr if the directory is excluded by grep?
Asked by Velkan
(581 rep)
Sep 29, 2016, 08:03 AM
Last activity: May 14, 2025, 07:05 PM
Last activity: May 14, 2025, 07:05 PM