How Do I Get the Latest File in a Directory in Linux?
Contents How Do I Find the Latest File in a Directory in Linux? Get Most Recent File in a Directory on Linux Watch -N1 ‘Ls -Art | Tail -N 1’ – Shows the Very...
Contents
How do I find the latest file in a directory in Linux?
Get most recent file in a directory on Linux
- watch -n1 ‘ls -Art | tail -n 1’ – shows the very last files – user285594 Jul 5 ’12 at 19:52.
- Most answers here parse the output of ls or use find without -print0 which is problematic for handling annoying file-names.
19 июн. 2009 г.
How do I find the latest files in a directory?
find . -type f -exec stat -c ‘%X %n’ * : prints the last access’ time followed by the file’s path for each file in the current directory hierarchy; find .