Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to get a formatted time output using a such command in Mac OS X 10.7.5 (in the Terminal app):

stat -f "%m" -t "%Y" "myfilename.jpg"

However, it still gives me a unixtime, not the formatted string:

1349690206

What I'm doing wrong?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You have to add S for string output.

$ stat -f %Sm -t %Y file.txt
2012
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.