permission for all the files in a folder


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users permission for all the files in a folder
# 1  
Old 08-06-2012
permission for all the files in a folder

Hi Guys,

Is there a command or some way whenever any file is created in a folder is having a default permission.

Cheers!!!
# 2  
Old 08-06-2012
You can set a default permissions mask with umask for the current shell.
Though, you can't set execute permissions as default. Default is 0022 - issuing umask without parameters will show you the actual set mask.

Additionally setting the SGID-bit with chown to a directory will inherit the group of the directory to the files created in there. Maybe this helps.

Last edited by zaxxon; 08-06-2012 at 08:32 AM.. Reason: changed directory to shell
# 3  
Old 08-13-2012
Java enter acl ...

- if you have said "any file in any folder", then
Code:
umask

would suffice.

- when you need some mode - or permission - to be inherited by files in just one specific directory, that's when acl (access control list) comes to the aid.

- as I do not know what flavour of unix you are using, try

Code:
man getacl
man setacl

or

Code:
man getfacl
man setfacl

- one of these will do.

HTH

good luck, and success.

alexandre botao
("comets never dodge")
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

2. UNIX for Dummies Questions & Answers

Reset Permission Of Files and Folder

Hi, Call me stupid but i accidentally executed following command : find $INSTALLDIR/ -type f -exec chmod 644 {} \; now after which I am not able to run any command in system even ls command is giving me error for "permission denied" :( (5 Replies)
Discussion started by: itajooba
5 Replies

3. Red Hat

Use of Execute permission for folder

Hi All, What is the use of execute permission for a folder. I know "for execute a file(script file) we have to provide execute permission to that respective file".But what is the use to give execute permission to folder.Is it equal to read permission ? Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

4. UNIX for Dummies Questions & Answers

Folder permission

Hi, I created user1 & user2 on my Linux machine. User2 cannot access home directory of user1. How user2 access the user1 home directory without changing owner of the directory. from root user, i tried chmod 755 /home/user1. But user2 trying to change directory it provides permission denied... (1 Reply)
Discussion started by: mdnowshath
1 Replies

5. Solaris

Need to transfer files between 2 UNIX servers, with same folder permission

I need to transfer directories/files between 2 Unix servers, with same folder permission. I tried scp, but it retains the the permissions, but changes the owner of the directory/file to the user used to copy them to the destination. I don't want that to happen. If possible without any other... (6 Replies)
Discussion started by: Pandee
6 Replies

6. Shell Programming and Scripting

[Solved] Retrieve all the permission of the /bin folder

hello friends, By mistake I have run find / -type f -exec chmod 644 {} \; now all permission has been chaged of /bin I am not able to change the permission. I am working on the virtuozzo VPS. Is their any way to retrieve the permission to 770 to /bin Note /bin/chmod also not executing... (2 Replies)
Discussion started by: sharlin
2 Replies

7. HP-UX

Lost Read permission on my folder

Hi I am a normal user on a HP-UX system which is meant for a large group. There are few directories which I think i am owner of. (Name of these directories is same as my username, and I usually have all the permissions in these directories). I was trying to give read and execute... (2 Replies)
Discussion started by: grvs
2 Replies

8. UNIX for Dummies Questions & Answers

Permission for particular folder

Hi All, I want to change a permission 755 only for a folder <log> under the directory recursively /home . but all other folder permission remain same under /home Thanks in advance Chakkaravarthy (8 Replies)
Discussion started by: chakkaravarthy
8 Replies

9. HP-UX

Folder permission

Hi guys, When I switch my user. I cant go to one of the folders. seems that this user has no right to access the folder. can you please help me to give the right to this user in order for him to access to the folder? it gives me permission denied. (2 Replies)
Discussion started by: messi777
2 Replies

10. UNIX for Dummies Questions & Answers

Folder permission denied

Hi, I tried to create a new folder inside a folder A but was given an error "Permission denied". Any idea? (4 Replies)
Discussion started by: trivektor
4 Replies
Login or Register to Ask a Question