Chris Barrett
Chris Barrett

Reputation: 601

Return Date modified in Epoch ms using stat

I'm trying to get a list of file along with their modified time. I'm currently using find ~/Desktop -print0 | xargs -0 stat -f '%m %N' but this is only accurate to the second. Is there a way to format it for ms? I've tried google searches but a bit new to this and unsure of the terminology

Upvotes: 1

Views: 204

Answers (1)

Philippe
Philippe

Reputation: 26582

The default stat not giving milliseconds, you need to install coreutils :

brew install coreutils

Then

find ~/Desktop -print0 | xargs -0 /usr/local/Cellar/coreutils/8.31/libexec/gnubin/stat --format='%.3Y %N'

Upvotes: 1

Related Questions