Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: detecting file type

  • Subject: Re: detecting file type
  • From: Michael Heiming <michael+USENET@xxxxxxxxxxxxxx>
  • Date: Sat, 24 Dec 2005 10:30:45 +0100
  • Newsgroups: alt.linux, alt.os.linux, comp.os.linux.misc
  • Organization: huhu
  • References: <zoudnWO2aPjrbzHeRVn-uw@comcast.com> <doj2ev$stv$2@godfrey.mcc.ac.uk>
  • User-agent: tin/1.7.10-20050929 ("Tahay") (UNIX) (Linux/2.6.14-mh (i686)) tinews.pl/1.1.7
  • Xref: news.mcc.ac.uk alt.linux:73187 alt.os.linux:241458 comp.os.linux.misc:606138
In comp.os.linux.misc Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>:
> __/ [Eric] on Saturday 24 December 2005 07:02 \__

>> Hi,
>>   I've got some files on my disk that i find are in dos text format. This
>> was unexpected and now I am wondering how many are like that. Is there a
>> tool or thing like find that will tell me what files are in dos format
>> ie something like:    find . -type f -format dos -print
>> Thanks
>> Eric

> This will have pitfalls, but regardless:

> find . -type f  | grep '.dos' | wc -l

Why should all those files end in .dos? If you wouldn't need
grep, but utilize find's '-name ...'.

Something like this could be a start, might need some more work
left for the OP as exercise:

	for f in `find . -type f -print 2>/dev/null`; \
	do  file $f| grep CRLF ;done | wc -l

-- 
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@xxxxxxxxxx | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 58: high pressure system failure

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index