A quick question. When do a ll command in unix, we get the file listing the timestamp at which it was modified/created. Usually it will be in the format of MMM dd HH:MM. How can i get this converted to epoch time?

For ex: ll abc.txt

Output: -rw-rw-r-- 1 maria_dev maria_dev 105 Mar 25 12:00 abc.txt

How can I convert this Mar 25 12:00 to epoch time.

Note: Here year is not being listed also

  • Do you want to convert a previous ls -l output, or change the time-style when ls -l is run? Mar 26, 2020 at 14:55

1 Answer 1


If you’re using GNU ls, you can use its --time-style option:

ls -l --time-style=+%s
  • Or TIME_STYLE=+%s ls -l also.
    – user232326
    Mar 26, 2020 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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