Linux 如何仅显示选定两个月内最后一次修改的文件?
我正在尝试过滤我的输出,以仅显示在“一月”和“二月”中创建的文件。有没有一种不用grep就能做到这一点的方法 需要能够从“一月”和“二月”切换到“一月”和“三月”等。请尝试以下操作:Linux 如何仅显示选定两个月内最后一次修改的文件?,linux,Linux,我正在尝试过滤我的输出,以仅显示在“一月”和“二月”中创建的文件。有没有一种不用grep就能做到这一点的方法 需要能够从“一月”和“二月”切换到“一月”和“三月”等。请尝试以下操作: 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' |
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'
试试这个:
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'
ls仅用于控制目的-类型f可能是想要的限制,也可能不是<使用finds-printf格式可以省略code>xargs-ls-lh,有关多个选项,请参阅手册页
ls仅用于控制目的-类型f可能是想要的限制,也可能不是<使用finds-printf格式可以省略code>xargs-ls-lh,有关多个选项,请参阅手册页 每个2018年1月/2月或最后一个2018年1月/2月或1月/2月的可能副本?2018年1月/2月或最后一个2018年1月/2月或1月/2月的可能副本?2018年1月-2018年2月我当前的命令是“查找/-大小+30M 2>/dev/null | xargs ls-lh |排序-n”。我将把它放在哪里?添加的版本靠近您的尝试再次感谢您的帮助,总是很感激:)我当前的命令是“find/-size+30m2>/dev/null | xargs ls-lh | sort-n”。我应该把它放在哪里?在您的尝试旁边添加了一个版本再次感谢您的帮助,非常感谢:)