Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个关于终端命令的问题。在工作中,我们每天都会在一个文件夹中收到许多文件。今天,我们决定将这些全部文件收集到文件夹中,使用年份和月份作为一项规则。
问题,例如,我如何移动上次修改日期在 2013 年 4 月范围内的所有文件。
find您可以使用该命令轻松选择修改时间在时间范围内的文件。这是一个使用 gnu find 的示例,它使这变得相当简单:
find
find . -newermt 'Apr 1, 2013 00:00' -not -newermt 'May 1, 2013 00:00' \ -exec mv -t /path/to/April_2013/directory '{}' '+'
man find所有血淋淋的细节。
man find