I want to know how much damage a user can do on my system if he decides to delete everything (or write to in case of corruption).
What command or script might i use to check this?
You need to search for directories the user can write. Files don't have delete permissions. Try the command to find the easy directories. This should list /tmp and the uses home directory tree.
This will miss any directories under directories the user can't scan into. However, they would also be missed by a wildcard delete. This list only goes three levels down which should get most of trees the user can write to. Change or drop the maxdepth to suit.
A more complete check would be any directories which meet one of these criteria:
The users will be able to delete files and directories below these directories. There are exceptions which will prevent deletion of everything below these directories. Being able to delete files in a directory, does not infer the directory may be deleted.
All bets are off if the user is root. However, there are permissions which can be set preventing even root from deleting a file.
With that user, execute:
writes a list of files to