简体   繁体   中英

How to Find Recent or Today’s Modified Files in Linux

I have a requirement that will have to find out latest modified files list along with date and time. mainly we have 2 files that boot.properties and ldap related files as part of beadmin password change activity.

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

is giving only boot.properties but I need to find other files which is in different location.

try something like this if you have different location and file names.

find /root_directory \
\( \( \
 -path "/target_directory1/*" -type f  -name "*boot.properties" \) -o \( \
 -path "/target_directory2/*" -type f  -name "*boot2.properties" \
 \) \) -exec ls -ltr {} \;

also, you have other options to find by modified date too. check this articlehttps://www.cyberciti.biz/faq/linux-unix-osxfind-files-by-date/

find支持多个路径参数,因此您可以执行以下操作

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM