Quote:
Originally Posted by konenas
Thanks!
date is a standard and has more options than stat
Code:
date -r $file +'%Y-%m-%d %H:%M:%S'
|
Note that this will fail if $file contains spaces or other pathological characters. It should be:
Code:
date -r "$file" +'%Y-%m-%d %H:%M:%S'
But note that the -r option to date is non-standard, and will not be available on all systems; stat is also non-standard and the syntax varies between systems.