查找/test文件夹下最旧的10个以 txt 结尾的文件 ,将他们一次性移动到另外一个目录/tmp
find /test -name "*.txt" | xargs ls -rt | head -n 10 | xargs -i mv {} /tmp/
查找/test文件夹下最旧的10个以 txt 结尾的文件 ,将他们一次性移动到另外一个目录/tmp
find /test -name "*.txt" | xargs ls -rt | head -n 10 | xargs -i mv {} /tmp/