我试图过滤我的输出以仅显示在“Jan”和“Feb”中创建的文件。有没有办法不使用 grep 来做到这一点?
需要能够从“Jan”和“Feb”切换到“Jan”和“Mar”等。
最佳答案
试试这个:
find . -newermt "31 Dec 2017" -not -newermt "28 Feb 2018"
或满足您的特定需求:
find . -newermt "31 Dec 2017" -not -newermt "28 Feb 2018" -size +30M -printf '%s %p\n' | numfmt --to=iec | sort -h
或者如果你想保留你的命令:
find . -newermt "31 Dec 2017" -not -newermt "28 Feb 2018" -size +30M -print0 |
xargs -0 ls -lh | sort -h
检查:
man find | less +/'-newerXY reference'
关于linux - 如何仅显示两个选定月份内最后修改的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49350468/