首页 > 解决方案 > 如何在 Linux 中查找最近或今天修改过的文件

问题描述

我有一个要求,必须找出最新修改的文​​件列表以及日期和时间。主要是我们有2 个与 boot.properties 和 ldap 相关的文件作为 beadmin 密码更改活动的一部分。

find /target_directory -type f -name "*boot.properties" -exec ls -ltr {} \;

只给出 boot.properties 但我需要找到位于不同位置的其他文件。

标签: linuxfiledateunixtimestamp

解决方案


find支持多个路径参数,所以你可以做类似的事情

find /target_dir /other -type f \( -name "*boot.properties" -o -name "other*" \) -exec ls -ltr {} +

推荐阅读