How can I change permissions of a folder, including its enclosed files and subdirectories?
I need to recursively change the permissions of all folders, sub-folders and files from within ~/.local/share/Trash/expunged
Does anyone have a clue or idea on how to do this?
I have tried following the instructions from this question but to no avail. chmod -R ug+rw <foldername>
doesn't seem to be working for this folder, its subdirectories, or enclosed files.
Does anyone know the chmod
command to change these permissions? For example:
root@santos:/home/santos/.local/share/Trash# ls -l
total 12
drwx------ 3 santos santos 4096 Mar 21 21:38 expunged
drwx------ 2 santos santos 4096 Mar 21 21:38 files
drwx------ 2 santos santos 4096 Mar 21 21:38 info
Solution 1:
From the screenshot it seems like the chmod command worked well. As you wrote chmod -R ug+rw
it gave a read/write permission to the user and group of the recursive folders.
If you want to give everybody a read/write permission you should add 'a' to your command so that it will be chmod -R uga+rw
.
Solution 2:
try by using numeric values
chmod -R 660 directorymainname