really cool find argument

Was sorting through some old directories of books and wanted to see which files were not actual text documents (or some related files such as images). The GNU find command is simply amazing:

[code]find . -regextype posix-egrep -type f ! -iregex ‘.*\.(txt|pdf|mobi|epub|htm|jpg|djvu|doc|rtf|gif|html|docx)’ [/code]

GNU find is part of the findutils package in Cygwin, Debian, and most other Linux distros.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *