在root模式下: # #delete files in trash # #date:2010-3-5 # #maker:tootwo # dir=/root/.Trash [ -d $dir ] x=$? y=0 if test $x -eq $y then (for i in $dir/* do rm $i echo "$i has been delete!" done) fi echo "Trash has been empty!"