bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excluding files with grep


From: Tony Abou-Assaleh
Subject: Re: Excluding files with grep
Date: Wed, 1 Nov 2006 12:44:25 -0400 (AST)

Are the undamaged files text files that are guaranteed to have some
printable characters anywhere in the file?

If so, then the following worked on my testing:

grep -rHc '[[:print:]]' mydirecotry | grep ':0$'

Cheers,

TAA

-----------------------------------------------------
Tony Abou-Assaleh
Email:    address@hidden
Web site: http://tony.abou-assaleh.net
----------------------[THE END]----------------------

On Wed, 1 Nov 2006, DarkRick wrote:

>
> Hi Jian Wang-4,
>
> I have a lot of files in different folders, and some of them are damaged. A
> damaged file looks like a normal file in size,  i.e 300 Kb, but all the 300
> Kb of the file is 00 in hexadecimal format.
> I don't know exactly which files are damaged, so and I found this needing:
> 1. To list the files that are ok and exclude all damaged files (That are not
> full of 00 in hexadecimal format), but that it is not useful because I need
> to replace the damaged files, or
> 2. To list the files full of 00 in hexadecimal format
>
> I tried the second choice with this sentence:
> $ find / -type f -print | grep ^[1-9A-Za-z]
> It would return the files that doesn't contain the character set that I want
> to remove, but it returns nothing.
>
> Thanks a lot.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]