|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to create a file with 777 permission.?
Hi Guys,
I want to know is there any method to create a file having 777 permission. I am aware of umask, since it is only giving max. 666 permission for files this is not fulfilling my needs. Thanks in advance ---------- Post updated at 12:49 AM ---------- Previous update was at 12:31 AM ---------- |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
umask
Hi, Before going to touch the file, use the umask command. Code:
umask 777 touch filename Cheers, Ranga
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thank you for the reply. But I think the maximum value that we can give for umask is 000.? So that it will create create maximum permission for files and folders.? files (666-000) & folders (777-000). I tried by giving umask 777, it is not even giving any permission also.
![]() |
|
#4
|
||||
|
||||
|
umask
which operating system you are currently working on?
It's working fine in my unix system. Cheers, Ranga ![]() |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
@rangarasan: umask doesn't work that way. It masks permissions defined in its parameter and not provides permissions.
So, when you say umask 022 , you're masking write permission for group and others. @sanoop: When you say umask 777 , you're masking all permissions. So no permission will be provided to file. A work-around would be to create a file and then provide necessary permissions: touch filename; chmod 777 filename |
| The Following User Says Thank You to balajesuri For This Useful Post: | ||
rangarasan (02-21-2012) | ||
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
umask
Thanks mate
![]() |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
@rangarasan - I have sun operating system
@balajesuri - Yes you are correct, I am getting zero permission for the file. ---------- Post updated at 01:34 AM ---------- Previous update was at 01:30 AM ---------- @balajesuri - Yeah, but I want to avoid the scenario where changing permission after creating a file using chmod. Do you guys believe there is no other method to achieve the same.? |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mkdir: cannot create directory `/builds/somedir/': Permission denied | Technext | UNIX for Dummies Questions & Answers | 5 | 06-01-2011 03:12 PM |
| How to create a file with full permission in unix script | sbmk_design | Shell Programming and Scripting | 2 | 12-01-2009 02:33 PM |
| How to create file in ksh scripting with permission(rw-rw-rw) | mansa | Shell Programming and Scripting | 1 | 11-16-2008 06:39 AM |
| permission on file | sourav_ray | UNIX for Dummies Questions & Answers | 1 | 10-17-2008 09:20 AM |
| file permission/acl: 2 users with write access on 1 file... | elzalem | Security | 0 | 08-28-2008 05:25 AM |
|
|