Home » Questions » Computers [ Ask a new question ]

Find most recently modified file in a directory

Find most recently modified file in a directory

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?

Asked by: Guest | Views: 197
Total answers/comments: 2
Guest [Entry]

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

ls -tl"
Guest [Entry]

"To narrow down a guess (here 50 minutes ago) while looking recursively in a directory structure and excluding a couple of paths:

find -name .git -prune -o -name another_exclusion -prune -o \( -newermt ""now - 50 min"" -ls \)"