About read,write & execute permissons of a directory | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

About read,write & execute permissons of a directory

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-29-2009
vishwasrao vishwasrao is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 14 April 2009, 7:30 AM EDT
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Bug About read,write & execute permissons of a directory

Hi all,
I want to know differences between read,write & execute permissons given to directory.
Thanx in advance.
Sponsored Links
    #2  
Old 01-29-2009
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
Read: owner/group/other may list the directory contents
Write: owner/group/other may create new entries
eXecute: owner/group/other may chdir into directory

HTH
Sponsored Links
    #3  
Old 01-29-2009
vishwasrao vishwasrao is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 14 April 2009, 7:30 AM EDT
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Bug About read ,write,execute permissons of directory

Quote:
Originally Posted by pludi View Post
Read: owner/group/other may list the directory contents
Write: owner/group/other may create new entries
eXecute: owner/group/other may chdir into directory

HTH
Hi pludi,
thanks for ur reply.But i think it is necessary to have read permisson to directory before write it .i mean if u give write permisson to directory & not read permisson will it work?
    #4  
Old 01-29-2009
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
Of course. Simplest way to explain would be something like a suggestion box. Say you have a directory 'suggestions', with permissions set to 0722 (drwx-w--w-). User can edit their own files in that directory, but can't list files other users might have created. Only the owner of that directory can do that.
Sponsored Links
    #5  
Old 01-29-2009
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
 
Join Date: Jun 2003
Last Activity: 10 January 2014, 5:37 AM EST
Location: Scotland
Posts: 594
Thanks: 1
Thanked 28 Times in 27 Posts
Hey,

Take a look at the FAQ article: http://www.unix.com/tips-tutorials/1...rmissions.html

HTH
Sponsored Links
    #6  
Old 01-29-2009
vishwasrao vishwasrao is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 14 April 2009, 7:30 AM EDT
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Bug

Quote:
Originally Posted by pludi View Post
Of course. Simplest way to explain would be something like a suggestion box. Say you have a directory 'suggestions', with permissions set to 0722 (drwx-w--w-). User can edit their own files in that directory, but can't list files other users might have created. Only the owner of that directory can do that.
Thanx my doubt get cleared.one more question what is 0 at starting of 0722
or d in drwx_w__w_.
Sponsored Links
    #7  
Old 01-30-2009
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
The first number in this group of 4 is for the special bits. '0' means nothing, '1' is the "sticky bit", '2' the "set group ID", and '4' the "set user ID" bit. '4' is probably the most used of those, as it changes execution of a program so that it doesn't run as the calling UID, but as the one of the file owner (same for the SGID bit, only with the group instead of the user). The passwd utility most often has this one set, as it requires root privileges to change the password file, but any user should be able to run it.

The effects of the "sticky bit" vary between platforms, and whether it's set on a file or directory. For files it originally was intended to tell the kernel "Keep this file in memory after it ended" so that subsequent calls wouldn't need to reread it from disk (not working in Linux). For directories it means "only the owner of this file may manipulate it", eg. on the /tmp dir, where every user may write, but others shouldn't be able to delete or modify a file there.

The first character in an ls -l output (in your example 'd') specifies the file type. '-' is a regular file, 'd' is a directory, 'c' is a character device, ....

HTH
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find all files with group read OR group write OR user write permission shunter63 Shell Programming and Scripting 5 01-14-2009 12:06 PM
Default read/write/execute permissions joeyg UNIX for Dummies Questions & Answers 1 08-25-2008 02:56 PM
Pls Help-Script to execute Commands and write to excel file Computer_baby Shell Programming and Scripting 1 01-08-2008 07:34 AM
How to read and write directory or file contents in c++ ? namrata5 Programming 3 09-28-2007 03:58 PM
Urgent!! How to write a shell program to execute command to access internet? firebirdonfire UNIX for Dummies Questions & Answers 2 04-26-2001 11:16 AM



All times are GMT -4. The time now is 02:38 AM.