I want to write a command that gives me the newest file in a directory recursively. But that's not my only limitation. The files has to be an mp3 or a jpg file. (case insensitive prefered) I only need the creating date of that newest file. If possible I want it formatted like this: 30-12-2014 (so: day-month-year)
This is currently wath I've got:
find . -name '*.mp3' -or -name '*.JPG' -printf "%TD \n" | sort -rn | head -n 1
But it doesn't work well. I only get JPG's and the date isn't formatted.