Find files that contain filler (0x00)

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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 'x00NNN' File









share|improve this question























  • Please try my updated answer -- sorry for the first version.
    – mosvy
    Oct 1 at 0:25














up vote
0
down vote

favorite












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 'x00NNN' File









share|improve this question























  • Please try my updated answer -- sorry for the first version.
    – mosvy
    Oct 1 at 0:25












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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 'x00NNN' File









share|improve this question















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 'x00NNN' File






grep find search






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 30 at 23:54

























asked Sep 30 at 23:44







user313572


















  • Please try my updated answer -- sorry for the first version.
    – mosvy
    Oct 1 at 0:25
















  • Please try my updated answer -- sorry for the first version.
    – mosvy
    Oct 1 at 0:25















Please try my updated answer -- sorry for the first version.
– mosvy
Oct 1 at 0:25




Please try my updated answer -- sorry for the first version.
– mosvy
Oct 1 at 0:25










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










grep -rlaP 'x004096' your_directory


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






share|improve this answer






















  • This is perfect, works. Thanks.
    – user313572
    Oct 1 at 0:53










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472471%2ffind-files-that-contain-filler-0x00%23new-answer', 'question_page');

);

Post as a guest





























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










grep -rlaP 'x004096' your_directory


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






share|improve this answer






















  • This is perfect, works. Thanks.
    – user313572
    Oct 1 at 0:53














up vote
1
down vote



accepted










grep -rlaP 'x004096' your_directory


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






share|improve this answer






















  • This is perfect, works. Thanks.
    – user313572
    Oct 1 at 0:53












up vote
1
down vote



accepted







up vote
1
down vote



accepted






grep -rlaP 'x004096' your_directory


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






share|improve this answer














grep -rlaP 'x004096' your_directory


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







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 1 at 0:24

























answered Oct 1 at 0:06









mosvy

1,837110




1,837110











  • This is perfect, works. Thanks.
    – user313572
    Oct 1 at 0:53
















  • This is perfect, works. Thanks.
    – user313572
    Oct 1 at 0:53















This is perfect, works. Thanks.
– user313572
Oct 1 at 0:53




This is perfect, works. Thanks.
– user313572
Oct 1 at 0:53

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f472471%2ffind-files-that-contain-filler-0x00%23new-answer', 'question_page');

);

Post as a guest













































































qqtdwfF LL Vm,PHPz
z8qOMv,rDbeOD oeWreuZn36wdHZRCNcaCHFdfc0TYnT7 LV PhLLxld

Popular posts from this blog

How to check contact read email or not when send email to Individual?

How many registers does an x86_64 CPU actually have?

Displaying single band from multi-band raster using QGIS