Truncate a directory

Cooked up a script to limit the number of files in a directory to a defined value. Thought I’d mention it here under this title and preface, to make it searchable, since I didn’t find anything premade using them as search terms.