1753792 Members
7659 Online
108799 Solutions
New Discussion юеВ

Permissions in One Shot

 
SOLVED
Go to solution
Rami Al-Lolah
Advisor

Permissions in One Shot

Anyone can tell, how can I apply a specific permission code on all the files, and the subdirectories found under a specific folder.

I want any information found under that specific directory to be inherited with the new permissions.
It is not too late to start.
8 REPLIES 8
Ken Hubnik_2
Honored Contributor

Re: Permissions in One Shot

chmod -R 700. The -R will will get all recursive directories.
Eileen Millen
Trusted Contributor
Solution

Re: Permissions in One Shot

Hi Rami,

chmod -R 750 directory_name

Would change the permissions to rwxr-x---
for directory name and everything under it.


you can use more intuitive options like
u for user permission
g for group permissions
o for everyone else

chmod -R u=rwx directory_name
Eileen
Clemens van Everdingen
Honored Contributor

Re: Permissions in One Shot

Hi,

chmod -R 644 or 755 or which permission needed.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Robin Wakefield
Honored Contributor

Re: Permissions in One Shot

Hi,

I believe you're looking at the command:

chmod -R perms pathname

e.g.

chmod -R ug+r,o-r,a+X /tmp/robin

Rgds, Robin.
Jean-Louis Phelix
Honored Contributor

Re: Permissions in One Shot

Hi,

chmod, chgrp and chown all have a -R' option for recursivity on subdirectories. Just notice that access rights on a directory is not the same as on a file :

for example :

- write on a file allows you to change its content
- write on directory allows you to change its content also, but in this case it means adding ou removing files.
So you can easily be able to have permission to delete files that you can't even read ...

Regards,

Jean-Louis.
It works for me (┬й Bill McNAMARA ...)
T G Manikandan
Honored Contributor

Re: Permissions in One Shot

chmod -R /dir

4-read(r)
2-write(w)
1-execute(x)

Ex.
chmod -R 755 /home
This will be as
-rwx-r-xr-x

Thanks
Rami Al-Lolah
Advisor

Re: Permissions in One Shot

Thank you all, such a quick response is unbelievable.

I figured out what is the correct command through the man pages right after I posted the question.

When I came back to share what I found 'chmod -R go-w *' I saw a huge number of replies.... Thanks anyway
It is not too late to start.
Mark Ellzey
Valued Contributor

Re: Permissions in One Shot

If you want these permissions to remain permanent, (i.e. when new files are created by the users), you'll need to set the 'umask' command in the user's .profile, .cshrc or .login file. If you want global permission control, set 'umask' in /etc/profile or /etc/csh.login, depending on the user's shell.

Regards,
Mark