xxxxxxxxxx
stat myfilename.txt | grep "Modify"
xxxxxxxxxx
if [[ $(find PATH_TO_FILE -mtime +$ageYouWantToCompareToInDays -print) ]]; then
echo "File is older then the given amount of days"
else
echo "File is younger then the given amount of days"
fi
xxxxxxxxxx
filename="path/to/file.txt"
# Check if file exists
if [ -f "$filename" ]; then
# Get last modified date
last_modified_date=$(stat -c %y "$filename")
echo "Last modified date: $last_modified_date"
else
echo "File not found: $filename"
fi