Pete's Linux Advent Calendar 2008

The 9th day

Finding files of a certain type

Under Linux the extension does not always indicate the filetype. Executables for example can be a binary or script, written in different languages. Say you want to find python scripts:
find . -type f -print0 | xargs -0 file | grep ".*:.*python" | cut -d: -f1

Pete's Linux Advent Calendar 2008

Valid HTML 4.01!

Comments? send mail to pkruse@arcor.de my monogram