How to find file creation / modified date using Unix commands in terminal window

/

If you’re ever using PuTTy or another terminal window to SSH into your server and you want to know “how old is that file” (or, at least, what date was it last modified) then the command below will allow you to find out just that information!

How to find file creation date using Unix ls command

ls -lrt FILENAME | tr -s " " | cut -d" " -f6-9

Obviously, insert the actual name of your file instead of FILENAME…

Leave a comment

Try it yourself, and leave a comment below if this worked – or didn’t work – for you.

Really, leave a comment

Especially if you think of other, better ways of doing similar things. Here’s a thing: when it comes to web servers, I tend to like CentOS as a Linux OS flavour. Discuss.