Friday, July 20, 2018

Finding files with in date range

Here is the command for find files that was modifed between 1st July 2018 to 20th July 2018 with it's details,

find . -type f -name "*.php" -newermt 2018-07-01 ! -newermt 2018-07-21 -exec ls -l {} \;

Please note, you have to mention next date of till date.

No comments:

Find and clear log files in Linux

Objective: Find and clear the files with extension of *.log, usually log files. Commands: find . -type f -iname *.log -exec tee {} \;...