$ export LASTFILE=`ls -t | head -n 1` $ for MYFILE in `ls | grep -Ev $LASTFILE` ; do mv $MYFILE newdir; done