Linux Server and Workstation Configuration How To

  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • red color
  • green color
chmod PDF Print E-mail
Friday, 04 December 2009 16:01
AddThis Social Bookmark Button

Command chmod

chmod command changes the permissions of one or more files.

Syntax

chmod [-cfvR] permissions files

Options

-c displays only files with changed permissions.
-f suppress error messages.
-v displays detailed information about changes of access rights.
-R recursively changes the permissions of files in all subdirectories.

Description

To effectively use chmod to know how to set permissions. One ways involves a concatenation of one letter from each of the following tables consecutively (Who / Action / Access):

 

Who

Action

Access

u user + add r read
g group - delete w write
o others = assign x execute
a all s set user ID  

To grant read access to all files in directory, type chmod a+r *. For permit the execution of the file to all users, type chmod + x filename.

Another way to specify permissions is to use sequence CONTRACT PERIOD three octal digits. In a detailed listing of the right to read, write and execute for user, group and others look like a sequence rwxrwxrwx (with a dash in place of letters for prohibited transactions). Row rwxrwxrwx can be regarded as a three-fold repetition of the line rwx. Now set the value r = 4, w = 2 and x = 1. To obtain the sequence rwx, add the values r, w and x. Thus, rwx = 7. Using this formula, you can assign three-digit value of any rights of access.

 

Add comment


Security code
Refresh

Useful Links

Follow us on ...

  • Digg: hgevs
  • Facebook Page: 180986722511
  • Linked In Group: 2571120
  • Ning: linuxconfignet
  • Twitter: linuxconfignet

Friends

Thanks David Ayvazyan for provided useful information and discussions.
www.gnu.am (Armenian Translation)