Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use chmod to change the file permissions. But what if I needed to grant full control permission for the logged in user over a directory ?

share|improve this question

migrated from Aug 11 '12 at 6:07

This question came from our site for professional and enthusiast programmers.

you can chmod/chown/chgrp directories just as you can files – lynks Aug 10 '12 at 12:40
I typed: chmod u+rwx mydir and the command seems successful because the console does not give any errors. When I access the folder, I still find some files that does not have x permission for the current user. What is the reason ? Knowing that this folder is not created by me (the current user). – Jury A Aug 10 '12 at 12:45
check my answer below. – tomk Aug 10 '12 at 12:48
@JuryA: Ah, are you trying to recursively apply the new permissions to all child files/folders within the directory? chmod has a -R flag for this. – David Aug 10 '12 at 12:48
up vote 0 down vote accepted

Did your try

chmod u+rwx <your directory>

from the directory above the directory you want to change? Be aware that a user can only change permissions of files/directories he owns.

If you want to change permissions of a directory and any subdirectories and files you have to use

chmod -R u+rwx <your directory>

share|improve this answer

chmod works on files AND directories

share|improve this answer

correcting my response : setfacl -m u:jvmohan:rwx directory-name

This should set the acl on the directory for the specific user with name jvmohan

share|improve this answer
sry my mistake I think I made sandwith of chmod and chown ..let me correct my response to setfacl -m u:jvmohan:rwx d2 – Vamsi Mohan Jayanti Aug 10 '12 at 13:14
ofcourse with -R option you can set it recursively – Vamsi Mohan Jayanti Aug 10 '12 at 13:25

Your Answer


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.