how to delete a folder when there are file inside in linux code example
Example: linux delete files in folders without deleting the folder
find /path/to/directory -type f -exec rm -iv {} \;
find /path/to/directory -type f -exec rm -iv {} \;