60

I created a folder on the command line as the root user. Now I want to edit it and its contents in GUI mode. How do I change the permissions on it to allow me to do this?

1
  • You can use setfacl command.
    – Ramesh
    Commented Nov 13, 2013 at 20:31

4 Answers 4

81

If I understand you correctly, fire up a terminal, navigate to one level above that directory, change to root and issue the command:

chown -R user:group directory/

This changes the ownership of directory/ (and everything else within it) to the user user and the group group. Many systems add a group named after each user automatically, so you may want:

chown -R user:user directory/

After this, you can edit the tree under directory/ and even change the permissions of directory/ and any file/directory under it, from the GUI.

If you truly want any user to have full permissions on all files under directory/ (which may be OK if this is your personal computer, but is definitely not recommended for multi-user environments), you can issue this:

chmod -R a+rwX directory/

as root.

2
  • How can I undo the last command you gave?
    – tjons
    Commented Nov 15, 2013 at 3:55
  • 2
    @TJonS The last command opens (almost) all permissions to everybody, so undoing it depends on which permissions you want to revoke.
    – Joseph R.
    Commented Nov 15, 2013 at 10:24
24

Just type:

chmod -R 777 directory/

and it will be available to all.

1
  • 7
    Don't give 777 to any directory!
    – guntbert
    Commented Feb 2, 2020 at 21:34
7

Just use this linux command

sudo chown -R :users your_directory
2

how to change only root permission for the file.

$ sudo chmod 700 PathOfYourFile 

If you want to change all permission for all users then

$ sudo chmod 777 PathOfYourFile

table for different permission: user group others

rwx  rwx   rwx = 111 111 111

rw-  rw-   rw- = 110 110 110

rwx  ---  --- = 111 000 000

and so on...

rwx = 111 in binary = 7

rw- = 110 in binary = 6

r-x = 101 in binary = 5

r-- = 100 in binary = 4

You must log in to answer this question.

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