chmod (change permissions)

Changes the permissions of one or more files. Can specify permissions using codes or numbers.

Codes: u (owner),g (group),o (other),a (all);+ (add to current permissions),- (subtract from current permissions),= (replace current permissions);r (read),w (write), x (execute).

Numbers: 1= execute, 2 = write,4 = read

Format:    chmod modep filenames
Examples:  chmod a+x file7
           chmod 754 file8 file9

Example 1: Gives owner, group, and everyone execute permission on file7. See Chapter 9.

Example 2: Gives read, write, and execute permission to user; gives read and execute permission to group; gives read permission to everyone. The mode is determined by adding the permission numbers for each category separately; e.g., 1(execute)+2(write)+4(read)=7. ...

Get Spring Into Linux® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.