I have multiple sub-directories (which are named using GUIDs), which contain results files from computer simulations that I have been running. The files are all named in the following way: hydro_configuration_xxxx.xyz, where xxxx is a four-digit number from 0000 upwards; the latest file has the highest four-digit number. I would like to be able to list the latest file in each subdirectory, along with the directory that it is in.
So, for example, given sub-directory fc86783b-bcc5-4456-8964-049682ee81aa containing files hydro_configuration_0000.xyz to hydro_configuration_0123.xyz, and directory e608273d-35bd-442c-9de1-0ec184aa0d95 containing files hydro_configuration_0000.xyz to hydro_configuration_3564.xyz, I need a command that produces the output:
./fc86783b-bcc5-4456-8964-049682ee81aa/hydro_configuration_0123.xyz
./e608273d-35bd-442c-9de1-0ec184aa0d95/hydro_configuration_3564.xyz