Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I screwed up all my files permissions under a directory, how can I recover. Especially, how to change the files that is non-executable back to read-write-only?What I did wrong was that I chmod all the files and directories executable of the user.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

In a terminal (Ctrl+Alt+T) you could remove the executable bit from all files and directories in that path:

chmod a-x /the/screwed/up/path

Then you could add the executable bit back to all directories:

chmod a+X /the/screwed/up/path

This would leave you with no files in that path being executable for anyone, except for the directories being executable (searchable) for all users.

If you also want to apply this to all files in subdirectories in that path, add the -R option to both chmods.

share|improve this answer

If you like to use gui you can also nautilus in terminal (if needed with gksudo) and click on the file, permissions and tick/untick executable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.