0

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 ?

4
  • 2
    you can chmod/chown/chgrp directories just as you can files
    – lynks
    Aug 10, 2012 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, 2012 at 12:45
  • check my answer below.
    – tomk
    Aug 10, 2012 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, 2012 at 12:48

3 Answers 3

0

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>

0

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

0

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

2
  • sry my mistake I think I made sandwith of chmod and chown ..let me correct my response to setfacl -m u:jvmohan:rwx d2 Aug 10, 2012 at 13:14
  • ofcourse with -R option you can set it recursively Aug 10, 2012 at 13:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .