Off-topic: filtering stream of pathnames for glob'd exclusions

Seth David Schoen schoen at loyalty.org
Mon Apr 22 20:48:02 UTC 2024


Philip Prindeville writes:

> Hi,
> 
> Somewhat off-topic post but this is on a system that has Busybox installed so I can't use features that other shells might provide.
> 
> I have a stream generated by "find" of pathnames, and I want to delete (filter out) certain paths based on the contents of a file that holds exclusions.

If you can modify the find command itself, you could add a "-not -path"
clause with a glob pattern.

For example,

find / -not -path '*e*'

finds all paths on the system that don't contain the letter e.  If there
aren't too many such lines, you could make a "-not -path" clause for each of
them.


More information about the busybox mailing list