Delete files and folders recursively in subdirectories
You can do it using following
find /path/to/transfer -mindepth 2 -delete
-mindepth 2 parameter tells
find to ignore first two level of directories: searched directory itself, and all files and folders that are directly in it.
-delete parameter just simply tells
find to delete all files.
You can always add more parameters (for example
-mtime) according to your needs.
A failed answer:
rm -R transfer/user*/.
$ rm -R transfer/user*/. rm: refusing to remove '.' or '..' directory: skipping 'transfer/user1/.' $
Eliminates the contents of all of the users, but leaves empty user* directories. Although the "dot"/"period"/"current directory" won't be removed, it can be used as a starting point for recursive deleting under that location.
Update: Unfortunately, I need to retract any recommendation on using this answer. I actually did test this before posting, but upon hearing that it didn't work, I re-tested and it failed. Simply, nothing got deleted. Somehow, my earlier test must have been done incorrectly. I did find a way to handle this, but decided the update was so significantly different that the existing comments of this answer would not match the update well at all, so I posted the other (again, tested) solution as a different answer.