cd xxx && rm `ls -t | tail -n +6`
cd xxx && res=`ls -t | tail -n +6` && if [ ! -z $res ]; then rm $res; fi
ls -t 时间最新的在前
ls -tr 时间最老的在后
cd xxx && rm `ls -t | tail -n +6`
cd xxx && res=`ls -t | tail -n +6` && if [ ! -z $res ]; then rm $res; fi
ls -t 时间最新的在前
ls -tr 时间最老的在后
Copyright © 2013 Powered by MWeb, Theme used GitHub CSS. 豫ICP备16018939号-2