Difference between revisions of "grep/file masks"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(Created page with "This is because grep does not do its own file-filtering but relies entirely on the command line environment to translate file-mask specifications into a list of files, whi...")
 
(TC post)
Line 4: Line 4:
 
* will apply only to the current folder
 
* will apply only to the current folder
 
* will prevent grep from recursively searching any folders whose names do not also match
 
* will prevent grep from recursively searching any folders whose names do not also match
 +
==Links==
 +
* '''2020-02-04''' [https://toot.cat/@woozle/103602468124365262 #softwareGripe #grep #counterintuitive]

Revision as of 18:45, 5 February 2020

This is because grep does not do its own file-filtering but relies entirely on the command line environment to translate file-mask specifications into a list of files, which are then each passed to grep as a separate argument. This is a feature/defect of bash and possibly most other Linux command shells (investigation needed).

In short, grep does not have the ability to search recursively using a file-mask, and any mask entered:

  • will apply only to the current folder
  • will prevent grep from recursively searching any folders whose names do not also match

Links