0

My qbitorrent was set to preallocate files.

After a crash it lost a lot of torrents many of which were incomplete. (I purged it afterward, using deluge now)

I have a directory containing 1000s of folders and files in which I need to find the incomplete ones. I assume the filler used is 0x00, is there a simple command that would iterate over all files and echo the ones that contain 0x00's above some threshold?

After searching I found this but don't know how to complete it:

grep -P '\x00{NNN}' File
  • Please try my updated answer -- sorry for the first version. – mosvy Oct 1 '18 at 0:25
1
grep -rlaP '\x00{4096}' your_directory

Change 4096 to the actual length of a run of null bytes you're after.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy