Write a shell scripts which works similar to the Unix commands Head Tail
for dir in `ls` doif [ -f $dir ] then line=`wc -l $dir | cut -d" " -f1` echo $line if [ $line -gt 10 ] then head -2 $dir tail -3 $dir else echo "Less 10 line" cat $dir fi fi done