在文件夹结构中查找相同文件的最新副本

Kev*_*der 5 find path search

我需要在文件夹结构中获取 foo.txt 的路径。此结构中有多个 foo.txt 文件,但我需要一个自动化来查找最新的。建议?

Cos*_*tas 2

find . -iname foo.txt -exec ls -t "{}" \+ | head -n 1
Run Code Online (Sandbox Code Playgroud)