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

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -