bash remove random files from directory

Shell
find /path/to/dir -type f -print0 | sort -zR | tail -zn +1001 | xargs -0 rm

Source

Also in Shell: