Friday 2 May 2014

Find corrupted video files

After some problems with corrupted video files that would not play I found this command;

find -size +100M -exec file '{}' ';' |grep ": data"

That allows you to quickly find files that are not recognised as video files and you can then delete or fix as needed.

File is an incredibly versatile on linux and can be used to identify all sorts of filetypes, in this case I use it to find files of filetype "data", basically file's way of saying it doesnt recognise the file.

Happy hunting!