How to find last modified file in Linux?
To find the last modified file in Linux, you can use the find
command with the -type f
option to search for regular files only, and then sort the results by modification time using the -printf
option.
find /path/to/directory -type f -printf '%TY-%Tm-%Td %TT %p
' | sort -r | head -n 1
This command will search for regular files in the specified directory and print out their modification time and filename in the format YYYY-MM-DD HH:MM:SS /path/to/file
, sorted by the modification time in reverse order (i.e., from newest to oldest). The head -n 1
command will then select the first (i.e., newest) file from the list.
- Who Were The Vestal Virgins And What Was Their Role In Roman Religion
- How Has The American Holiday Shopping Experience Evolved Over Time
- How Do You Handle Nerves During A High Pressure Dart Game
- What Is The Role Of The Character Zeros Enforcer The Sumo Wrestler In John Wick Chapter 3 Parabellum
- Who Is The Creator Of The Lord Of The Rings Universe
- What Is A Planet
- What Are Some Popular Hiking Trails Near Boulder Colorado
- Is The Hisense H6510g Compatible With Apple Airplay
- Who Was The Most Thoughtful Character On How I Met Your Mother
- How Do They Even Choose Which Team Wears Which Color Jerseys