how to remove folders but keep files in linux commands 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 {} \;