Forrest logo
back to the find tool

find:ai:b6911

how do I recursively search a path and only show the most recently modified file with a timestamp?
$ find /your/path -type f -printf '%T@ %p
$ ' | sort -n | tail -n 1 | awk '{print $2}'
try on your machine

Recursively search /your/path for files and print their timestamp and filepath, then sort by timestamp and show only the most recent file with its filepath.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • how do I recursively search a path and only show the most recently modified file with a timestamp?
back to the find tool