#!/bin/csh -f if $#argv != 2 then echo Usage: $0 Filename_Size Directory else find * -prune -type f > filenames.txt endif set SIZE = `wc -l filenames.txt` @i=1 while ( i <= SIZE ) then set line = head -$i filenames.txt | tail -1 | wc -c if ( $line <= argv[1] ) then head -$i filenames.txt | tail -1 | xargs rm @i=i+1 else @i=i+1 end