解决:
1. ls | grep -v ttt | xargs rm {}
2. ls | grep -v ttt | xargs rm
3. mv ttt /tmp/ && rm -rf * && mv /tmp/ttt ./
4. find . -name e -prune -o -print | xargs rm -rf
5. find . -name e -prune -o -name dir -prune -o -print | xargs rm -rf {}
6. 删除目录下的除去ttt和目录外所有文件
d=/tjy/
for i in `ls $d`; do
if [ $i != "ttt" ];then
j=`file $d$i | awk '{print $2}'`
if [ $j != "directory" ];then
rm -rf $d$i
fi
fi
done