Shell: find the latest files in a tree


find the latest files

find . -type f -name -print0 | xargs -0 stat -f "%Sm %N" -t %Y.%m.%d-%H:%M:%S | sort -n | tail

find the latest modified jpg files

find . -type f -name "*.jpg" -print0 | xargs -0 stat -f "%Sm %N" -t %Y.%m.%d-%H:%M:%S | sort -n | tail

find the latest files and translate the / in |

find . -type f -name -print0 | xargs -0 stat -f "%Sm %N" -t %Y.%m.%d-%H:%M:%S | tr -s "/" "|" | sort -n | tail


return to gimbo wiki home page