#! /bin/sh LIST=`ls *.log` mkdir -p old/ cp *.log old/ for i in $LIST do awk '!(NF==5 && ($4+$5) > 1000000)' old/$i > $i done