[GLLUG] File search help

STeve Andre' andres at msu.edu
Mon Mar 5 00:02:19 EST 2012


Doing a man magic should tell you about the format of /etc/magic.

Fortunately, you can stare at the file to see how other formats are
done, and then start adapting.  I did it once long ago for strange
medical files.  Give it a couple of hours and you can get it.

--STeve Andre'

On 03/04/12 23:44, Stanley Mortel wrote:
> That looks promising, but I don't know how to teach it about 
> metadata.  Gives me something to look into though.  Thanks.
>
> On 03/04/2012 10:49 PM, STeve Andre' wrote:
>> Don't forget about file(1).  If you can teach /etc/magic (your opsys may
>> vary), about the metadata, then it could tell you whats what.
>>
>> Something like
>>
>>      cd dir
>>      find . -type f -exec file {} \;
>>
>> would run file on every file in dir and beneath.
>>
>> Strings works too, but it harder.  A
>>
>>    strings -12 file
>>
>> would print out only the readable strings longer than 12 chars,
>> which helps, but file is better.
>>
>> --STeve Andre'
>>
>> On 03/04/12 22:32, Chick Tower wrote:
>>> If this metadata is recorded in the files, Stan, and it's a text 
>>> string, grep should be able to find it.  The strings utility might 
>>> be needed to strip the text strings out of Word documents or other 
>>> formats, although I don't think it works well on .docx files.  See 
>>> "man grep" and "man strings" for more info.
>>>
>>> Do you need to do more than just find and list the files?
>>>
>>>
>>>                                Chick
>>>
>>> On 03/04/2012 09:13 PM, Stanley Mortel wrote:
>>>> I need to be able to search the metadata of files and find all that 
>>>> are
>>>> owned/authored by Computer Associates. I'm hoping this is possible, 
>>>> but
>>>> I haven't a clue how to proceed. Google hasn't turned up anything 
>>>> useful
>>>> (yet).
>>>>
>>>> I've seen some rather complex scripts to do this under Windows. Being
>>>> able to do it in Windows would be OK, but I'd rather do it in Linux.
>>>>
>>>> Any ideas?


More information about the linux-user mailing list