changing the permissions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting changing the permissions
# 1  
Old 02-08-2011
Java changing the permissions

HI,
I wann give permissions to a folder which contains multiple folders.....

how can i give permissions to all folder at a time
tat means if i give permissions to main folder it
the same permissions has to take on all the folders in the main folders

how can i use one command to give permissions
# 2  
Old 02-08-2011
Code:
chmod -R 660 /path/to/dir

will change the permissions of all folders and files inside the folder '/path/to/dir', including /path/to/dir itself.

To do just folders:
Code:
find /path/to/dir -type d -exec chmod 0600 '{}' ';'

Or just files:
Code:
find /path/to/dir -type f -exec chmod 0600 '{}' ';'

On systems that support it, you can change ';' to '+' to make it more efficient, reducing the number of times it calls chmod by using as many arguments as safely possible.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

changing directory permissions

Hi, Im getting this annoying problem on file permission when I copy a folder to a mounted external directory. the files inside the copied folders become all executable. I tried to search for ways how to undo the permission over the web but to no avail. tried this one but it doesnt change a... (2 Replies)
Discussion started by: ida1215
2 Replies

2. OS X (Apple)

rsync is changing permissions

I have the following command. This is meant to download all files from my server to the Downloads folder of my startup drive: /usr/local/bin/rsync -avve ssh --numeric-ids --delete --ignore-errors -R grndlvl@myserver.com:/usr/home/./grndlvl grndlvl@myserver.com:/usr/home/./grndlvl/mail_boxes/... (8 Replies)
Discussion started by: rlinsurf
8 Replies

3. UNIX for Dummies Questions & Answers

Changing permissions in a shell script

Hi All, I have a shell script which we keep on changing permissions on a On-Demand Basis-->for e:g--from 400(Read only) to 740(Execute permission) etc. Is there any way by which I can view the history of the script?-->I am interested in finding out the date-time stamps when the script's... (2 Replies)
Discussion started by: DevotedPupil
2 Replies

4. Shell Programming and Scripting

HELP changing file permissions

does anyone know how to write a script that will change file permissions. because the Admin blocked me from altering any of my files im only allowed to read and i heard a script like this can bypass it but i dont know how to write it. Display current users. Display user Ids only. Display... (10 Replies)
Discussion started by: live2learn
10 Replies

5. Cybersecurity

changing /cn@0:console file permissions

I'm doing a security sweep of a Sun Sol 5.8 system. The file: /dev/console, which links to /devices/pseudo/cn@0:console, has the following perms: crw--w--w- I would like to get rid of the world write permissions. I can change the file permissions, but as soon as log back in, they are changed... (4 Replies)
Discussion started by: ErnieG
4 Replies

6. UNIX for Dummies Questions & Answers

Changing file permissions

Is there a way to change a unix user's default file permissions so that when he creates a file, by default permissions are 777??? Thanks! (7 Replies)
Discussion started by: FredSmith
7 Replies

7. UNIX for Advanced & Expert Users

Changing file permissions on upload

Hello ! When I connect to a RH FTP server, the files I transfer (from my "windows computer") to this server have the following permissions : -rw------- but I would like those files to have the following permissions : - rw-rw-r-x How can I do that ??? :) Thanks for your help ! G. (6 Replies)
Discussion started by: guix
6 Replies

8. UNIX for Advanced & Expert Users

Changing permissions of a user

So I need to change the permissions of my user account. I can access the root account on the server, but don't know how to change the permissions of my user account. I was advised to try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Discussion started by: achink125
3 Replies

9. Shell Programming and Scripting

Changing Permissions

Is it possible to change the permissons for an entire directory in one shot? I'm telneting on to a linux server. ...just a beginner-- --Paul (4 Replies)
Discussion started by: pdavid
4 Replies

10. Shell Programming and Scripting

changing file permissions

Use the following to Change permission of fileB (fileB could be fileB*) to change its permission same as the permission of fileA. chmod `ls -l fileA | awk '{pr int "u+", substr($1,2,1), substr($1,3,1), substr($1,4,1), ",g+", substr($1,5,1), substr($1,6,1), substr($1,7,1), ",o+",... (0 Replies)
Discussion started by: gagansharma
0 Replies
Login or Register to Ask a Question