unix stat command trailing zeros after seconds -


how can remove many zeros (0000000 +0000) after seconds in output stat command in unix

filetime=$(stat --format=%y filename.txt) echo $filetime  2016-01-27 15:03:26.000000000 +0000 

try size

filetime=$(stat --format=%y filename.txt | sed 's/.000000000//') echo $filetime  2016-01-27 15:03:26 +0000 

Comments

Popular posts from this blog

java - Callback from new thread to class from which thread was initiated -

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -