[File] "file" as a type filter

Christos Zoulas christos at zoulas.com
Sun Jun 21 09:11:06 EDT 2026



> On Jun 20, 2026, at 1:37 PM, Gordon Messmer <gordon.messmer at gmail.com> wrote:
> 
> I've recently discovered executable binaries in source archives while building Fedora packages, and I'd like to extend the standard tooling to detect and remove content that is not allowed by policy.
> 
> 
> 
> Naturally, "file" seems like the tool best suited to identifying file content so that we can strip out what isn't wanted. But file's output types are both hard to parse reliably.
> 
> 
> 
> What I would really like is a tool that accepted file types (or MIME types) as command line arguments, and which accepted a list of files on stdin and provided a list of files that match one of the types on stdout. Something that could be used as a filter.
> 
> 
> 
> Would you accept a patch that added functionality like that to the "file" command? Or would you accept one that added a new "file-filter" binary?
> 
Sure, but you can use -f to supply the list of files and use --mime-type to just print the mime-type and use egrep to select the mime times you want.

Best,

christos

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.astron.com/pipermail/file/attachments/20260621/69ff7efa/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <http://mailman.astron.com/pipermail/file/attachments/20260621/69ff7efa/attachment.asc>


More information about the File mailing list