I accidentally did this:
chmod -R 777 /
I suppose to do this:
chmod -R 777 ./
I feel really bad now. How can I reverse this??
short version: You can't. Unless you have a backup or similar which lists the permissions of all your files, you don't know what the files need to be.
for allpkg in $(rpm -qa); do rpm --setperms $allpkg; done
resets file permissions for all installed packages. This does not help with user files...
sudo chmod -R -x /
.chmod -R 777 ./
would have been wrong too. It is extremely rare to need to set files to mode 777. I can't think of ever needing to set a whole directory hierarchy to mode 777.chmod -R a+rx .
orchmod -R u+w .
are common.chmod -R 777 .
was a mistake from the start.