Linux shell rm
#!/bin/sh num=`ls $1 | wc -l` if [ $num -gt 0 ] then ls -l $1 | awk '{print $9}' >/tmp/rm_dir a=0 while [ $a -le $num ] do fname=`cat /tmp/rm_dir | head -$a | tail -1` cd $1;rm -rdf $fname & a=`expr $a + 1` done else echo "$1 is empty" fi