Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Aug 11 '12 at 6:07

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

2  
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
add comment

3 Answers

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
add comment

chmod works on files AND directories
http://www.thegeekstuff.com/2010/04/unix-file-and-directory-permissions/

share|improve this answer
add comment

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
add comment

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.