delete all folder content linux code example
Example 1: linux remove folder and all his content
rm -rf /path/to/directory/*
Example 2: delete all folders except one linux
find * -maxdepth 0 -name 'b' -prune -o -exec rm -rf '{}' ';'
rm -rf /path/to/directory/*
find * -maxdepth 0 -name 'b' -prune -o -exec rm -rf '{}' ';'