What is the simplest way to output file ages instead of filedates by ls command?
Like "1 hour", "2 days", "3 weeks", etc.
(Sometimes file age is much more significant than date)
What is the simplest way to output file ages instead of filedates by ls command?
Like "1 hour", "2 days", "3 weeks", etc.
(Sometimes file age is much more significant than date)
I get the UNIX-Systemdate in seconds with NOW=date +%s
Then I get the UNIX-Timestamp of the file with OLD=stat -c %Z filename
And finally I get the age by expr $NOW - $OLD.