This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sometimes, when changing permission or ownership you run a command like | |
# chown -R www-data: .* | |
# and it does what you want correctly: change ownership on dotfiles | |
# but it does also what you don't want: change ownership on all files which are in the parent directory | |
# which is really bad | |
# the solution, taken from http://sysadminnotebook.blogspot.fr/2012/06/how-to-reset-folder-permissions-to.html | |
# 1. on a snapshot or another Debian installation run | |
find / -exec stat --format "chmod %a %n" {} \; > /tmp/restoreperms.sh |