stat command to check when the file was last modified and compare it to the current time using the standard date command. For example:
# Get the last modified time from stat
STAT_OUTPUT=`stat -c %Y test.txt`
# Get the current time
NOW=`date +%s`
# Calculate the difference between the last modified time and the current time
DIFF=$(( $NOW - $STAT_OUTPUT ))
# Check if the difference is less than 24 hours
if [ $DIFF -lt 86400 ]; then
echo "The file has been modified in the last 24 hours"
fi