Try this:
ls -t | sed -e '1,10d' | xargs -d '\n' rm
This should handle all characters (except newlines) in a file name.
What’s going on here?
ls -tlists all files in the current directory in decreasing order of modification time. Ie, the most recently modified files are first, one file name per line.sed -e '1,10d'deletes the first 10 lines, ie, the 10 newest files. I use this instead oftailbecause I can never remember whether I needtail -n +10ortail -n +11.xargs -d '\n' rmcollects each input line (without the terminating newline) and passes each line as an argument torm.
As with anything of this sort, please experiment in a safe place.