[lug] find command or similar

Kenneth D. Weinert mc at quarter-flash.com
Tue May 13 11:19:56 MDT 2003


Here's a little shell script that should do the trick. I use locate
because it's faster, but it could be replaced with:

find / -type f -print

locate \* | while read path;do
  file=$(basename $path); 
  res=$(echo $file | egrep "[[:alnum:]]{10,15}"); 
  if [ ! -z $res ];then 
    echo $path;
  fi;
done

Where I have {10,15} you could put {200,} for your first case and
{200.240} for your second.

Note that the [[:alnum;]] expression might not match all filenames -
you can do a "man egrep" and look at the regular expression syntax to
make it more closely conform to what you might find on your system.

On Tue, May 13, 2003 at 10:20:44AM -0600, Stephen G. (E-mail) wrote:
> Using current KRUD
> 
> Will someone please explain how I can find all files on a system with
> a name containing more than 200 characters?
> Or
> More then 200 characters but less than say 240?

-- 
/~\ The ASCII        Ken Weinert   mc at quarter-flash.com 
\ / Ribbon Campaign  303-452-6603 (V) 303-705-4258 (F)
 X  Against HTML     GnuPG: 9274F1CE  GnuPG available at http://www.gnupg.org/
/ \ Email!           1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE

		 The Instant of the first Atomic Bomb
    
    At that moment, man, made in God's image, had used his powers of 
scientific invention to make his first attempt to destroy himself.
   
    The attempt succeeded.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20030513/07bae068/attachment.pgp>


More information about the LUG mailing list