How to find when the last modification happened in a directory
How to find when the last modification happened within a directory on Linux?
Use the du command and show the last modification time by using the --time option.
du -sh --time
Use the du command to scan a directory and find when the last modification was made. The related modification time will be displayed when using du with the --time option.
# du -sh --time /var
1.2G 2024-06-01 21:45 /var
The time option will show the last modification time of a file or subdirectory within the directory that was specified.
Learn more about du
This article uses the du command to achieve its tasks. For this popular tool there is a cheat sheet available!
This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.
Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!