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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -