To list files that were modified on a specific date, you can use the find
command in combination with the date
command. However, the find
command doesn’t directly support searching for files modified on a specific date, so you’ll need to specify a range that covers the entire day.
Here’s how you can do it:
touch --date "2024-04-10 00:00" /tmp/start
touch --date "2024-04-10 23:59" /tmp/end
find /var/www/vhosts/ -name "*.php" -newer /tmp/start ! -newer /tmp/end
This command will create two temporary files, one with a timestamp at the start of April 10, 2024, and one with a timestamp at the end of April 10, 2024. It will then find all .php files in the /var/www/vhosts/
directory and its subdirectories that were modified between these two timestamps.
Please note that you might need to use sudo
before the find
command if the files require root permissions to read. Also, remember to remove the temporary files when you’re done:
rm /tmp/start /tmp/end