bug-grep
[Top][All Lists]
Advanced

[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: Wed, 1 Nov 2006 07:57:16 -0800 (PST)

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.



Jian Wang-4 wrote:
> 
> I don't know clearly what your problem is. Grep has an option '--exclude'
> used to exclude files. Is it what you want?
> 
> On 10/31/06, DarkRick < address@hidden> wrote:
>>
>>
>> Hi... I'm new in grep world... I have a set of files, a.txt, b.txt,
>> c.txt,
>> but when I open one of those (suppose c.txt) it's damaged and it's
>> content
>> is full of 00 in hexadecimal format. I'm trying to list all files
>> excluding
>> the damaged one, but the only solution that I could find didn't work. Any
>> ideas?
>>
>> I've tried this command first, "$ grep ^[1-9A-Za-z] *" but it shows files
>> that has content... then, I tried with find, but it listed all the files.
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Excluding-files-with-grep-tf2546079.html#a7116715
Sent from the Gnu - Grep mailing list archive at Nabble.com.





reply via email to

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