This is accomplished using stat command.
-c parameter is for the specified FORMAT instead of the default
%Y is for the Time of last modification as seconds since Epoch
#!/bin/bash
$file="/tmp/testfile"
file_time_stamp=$(stat -c %Y $file)
echo $file_time_stamp
Comments
Post a Comment