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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -