[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Excluding files with grep
From: |
DarkRick |
Subject: |
Re: Excluding files with grep |
Date: |
Thu, 2 Nov 2006 06:47:57 -0800 (PST) |
Hi Tony Abou-Assaleh-2,
I must suppose that the all the undamaged files have some printable
characters. I tried your solution and it works really good when I'm in a
Linux system. Thanks a lot.
But when I'm working with Unix Utils for a windows system it doesn't work.
What can I do? Or how should I fix it?
Thanks again.
Tony Abou-Assaleh-2 wrote:
>
> 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.
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/Excluding-files-with-grep-tf2546079.html#a7134945
Sent from the Gnu - Grep mailing list archive at Nabble.com.
- Re: Excluding files with grep, DarkRick, 2006/11/01
- Re: Excluding files with grep, Tony Abou-Assaleh, 2006/11/01
- Re: Excluding files with grep,
DarkRick <=
- Re: Excluding files with grep, Tony Abou-Assaleh, 2006/11/02
- Re: Excluding files with grep, Benno Schulenberg, 2006/11/02
- Re: Excluding files with grep, DarkRick, 2006/11/07
- Re: Excluding files with grep, Tony Abou-Assaleh, 2006/11/07
- Re: Excluding files with grep, DarkRick, 2006/11/08