By mistake I executed this command on Ubuntu 16.04
sudo chmod -R -x * && sudo chmod -R +X *
Now all the folder converted into files, which is not opening.
How can I fix it?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityYou have removed execution-rights (and thereby access to) all directories and eventually files that where executable.
Start by giving back exec to directories:
find . -type d -exec chmod +x {} \;
If you had any executable programs, then for each of these do:
chmod +x filename
The +x
in the commands above gives execute rights to all (user, group and others - the three different access levels in a linux/posix filesystem)). If you for some reason needs to restrict access to only user or user+group you can replace +x
with u+x
or ug+x
to achieve this.
x
only to u?
x
for u - I attempted it in my answer here Home files and folders permissions could not be determined
x
for u .. but besides that, you are right.
chmod
probably never ran, sincechmod
would show an error because it couldn't descend into any directories on which it had already set-x
.