Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I apologize that I wasn't entirely clear in my example as I tried to generalize it too much. Something closer to that I'm dealing with looks as follows: /somefilepath/moresubdirs_someDir_good_1_2/fileName1.txt or /somefilepath/moresubdirs_someDir_real_good_1_2/fileName1.txt. I appreciate your help though! Commented Dec 16, 2020 at 19:00
  • @C_Squared So use *good* or *_good_* instead of */good/* with -path? Commented Dec 16, 2020 at 19:04
  • I also believe I found something that works through trial and error. $ find . -type f ( -name someFile.txt -o -name someOtherFile.txt) | egrep -i 'realgood|real_good' Commented Dec 16, 2020 at 19:05
  • @C_Squared I wouldn't use grep on pathnames (as they can theoretically contain newlines). What you are showing there is the equivalent of \( -ipath '*realgood*' -o -ipath '*real_good*' \). Commented Dec 16, 2020 at 19:06
  • your ipath solution worked perfectly. Thanks! Commented Dec 16, 2020 at 19:15