How to get the last modified time of a file in Linux?
While I was writing a shell script, I needed the last modified time of a particular file before doing something, and here’s what I used:
stat -c ‘%Y’ /root/directory/file.txt
This command will give you the last modified time of a file in seconds (since Epoch).
About this entry
You’re currently reading “How to get the last modified time of a file in Linux?,” an entry on Singaram's Tech Musings
- Published:
- May 26, 2011 / 10:30 PM
- Category:
- Linux
- Tags:
- Epoch, Linux, Shell Script

No comments yet
Jump to comment form | comment rss [?] | trackback uri [?]