Linux – Find most recently modified file in a directory

bashcommand linelinux

What would be a good way, via the Bash command-line, to find the time of the last modification made to any of the files in a particularly directory?

Basically, I'm working on a project where all the project's files are within one directory, and I'm keeping a timesheet, and I forgot to note when I finished working on the project earlier today. Whichever file was modified last will give me that time.

I could guess at the time… but I thought it would be fun to get Bash to give me a more accurate answer 🙂

As an added bonus, I think the command will likely need to ignore certain directories, in particular the .git directory in this case.

Best Answer

I'm not sure what you're after, but this should work for quick checks:

ls -tl
Related Question