What is the unix command used for giving or changing the permissions for files and folders?

Questions by shyamjith

Showing Answers 1 - 19 of 19 Answers

Thiyagarajan

  • Nov 16th, 2005
 

chmod

  Was this answer useful?  Yes

Farhan Anwar

  • Jan 1st, 2006
 

chmod [ -R ] [ -h ] [ -f ] PermissionCode { File | Directory }-f Suppresses all error reporting except invalid permissions and usagestatements.-h Suppresses a mode change for the file or directory pointed to bythe encountered symbolic link.-R Descends only directories recursively, as specified by the patternFile...|Directory.... The -R flag changes the file mode bits of eachdirectory and of all files matching the specified pattern.You can get more info from: http://nersp.cns.ufl.edu/~dicke3/nerspcs/chmod.html Farhan AnwarNetwork and Systems AdministratorThe Aga Khan UniversityKarachi, Pakistan

  Was this answer useful?  Yes

Manjunath Doddamani NSC Banagalore

  • Jan 25th, 2006
 

Ex: chmod -x filename to make the file executable.simple method isOwner group others 4 4 4 R 2 2 2 W 1 1 1 X--------------------------------- 7 7 7 to give read, write, execution permissions (all permissions)

  Was this answer useful?  Yes

bibhu_personalresume

  • Feb 6th, 2006
 

pkh[k]gw

  Was this answer useful?  Yes

Soujanya

  • Feb 23rd, 2006
 

chmod

  Was this answer useful?  Yes

chmod command is used to change file permissionsyntax : chmod category operation permission filenamewhere category may be u = user ,g = group,o = others,a = alloperation may be '+' = assign permission,'-' = remove permission,'=' = exact permissionpermission may be r=read,w=write,x=executeEg: $chmod a+x file1 (give execute permission of file1 to all)

  Was this answer useful?  Yes

ajay

  • Aug 15th, 2006
 

The last answer is correct and perfect explaination except to the fact that its not the user but the owner who first of all are provided with the rights

By default its 644 and this default value is stored in umask variable for any file that the terminal user sets for his particular case.This value is stored in umask in OCTAL form that makes it 0022.

  Was this answer useful?  Yes

Chiranjeevi Manne

  • Mar 30th, 2007
 

chmod

  Was this answer useful?  Yes

Markerhell

  • Aug 26th, 2009
 

chmod category operation persmission filename(s)

category: user, group n others (u g o)
operation: assign or remove the permission (+, -)
permission: read, write or execute( r, w, x)

cmanne

  • Sep 2nd, 2009
 

the best was is to use CHOWN

Example:

chown owner:group <file_name>

chown -R owner:group <directory_name> <---- This will change the owner and group of all the files inside the directory recursively.

 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions