E-mail : support@tech2now.in

How to list all the file modified at one hours ago

Linux Linux command ls pwd cp mv more grep tail

Script to verify within the last one hour change file in current directory.

Create script using vim/vi check_lost_one_hours_modified_file.sh

#!/bin/bash

directory=”.”

#Get the current time and calculate the timestamp for one hour ago
current_time=$(date +%s)
one_hour_ago=$((current_time – 3600))

#Find files modified within the last one hour
find “$directory” -type f -newermt “$(date -d @$one_hour_ago ‘+%Y-%m-%d %H:%M:%S’)” -print

save escap :qw

Output:

$ ./check_last_one_hours_modified_file.sh
./check_last_one_hours_modified_file.sh
./11.txt