create a random file and delete it code example
Example: bash remove random files from directory
find /path/to/dir -type f -print0 | sort -zR | tail -zn +1001 | xargs -0 rm
find /path/to/dir -type f -print0 | sort -zR | tail -zn +1001 | xargs -0 rm