I'm trying to do something that looks pretty simple but I haven't been able to solve.
I have a directory with a bunch of subdirectories all of them with multiple files (jpg files). I want to execute a command which keep only 4 or N files inside of these directories. The order of the files isn't important as I have seen related questions depending on the time they were created
I have played with ls + head and trying to put find in a loop with the -delete option but still no luck.