On Fri, 2015-09-04 at 01:09 +0200, Jakub Wilk wrote: > For source code, we might use ack(1).
ack seems to use only extension and first-line matching, I think I would prefer to only use file/magic. > For binary files, I came up with this monster: > > find . -type f -exec sh -c 'file -i --print0 "$1" | cut -d "" -f 2 | grep -q > ": image/png;" && printf "%s\0" "$1"' sh {} \; Probably you want these arguments to file instead of -i? --mime-type --no-pad --no-buffer --separator "" > I'll probably write a new tool, so that you can write: > > find . -type f -print0 | mimegrep -0 image/png I think we would want the file tool to do this? find . -type f -print0 | xargs -0 file -0 --find 'image/png' --find 'text/*' This way you can paste the command into chroots too. -- bye, pabs https://wiki.debian.org/PaulWise
signature.asc
Description: This is a digitally signed message part