Last active
December 16, 2015 03:49
-
-
Save indrayam/5373107 to your computer and use it in GitHub Desktop.
Find how long ago file was modified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In OSX: | |
------- | |
echo "Token File = $TOKEN_FILE exists ..." | |
filetime=$(stat -f "%m" -t "%s" $TOKEN_FILE) | |
currtime=$(date +"%s") | |
secs_elapsed=$(($currtime-$filetime)) | |
In Linux: | |
--------- | |
echo "Token File = $TOKEN_FILE exists ..." | |
filetime=$(stat -c "%Y" $TOKEN_FILE) | |
currtime=$(date +"%s") | |
secs_elapsed=$(($currtime-$filetime)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment