(CHange MODe) A Unix command that changes the permissions (attributes) of a file or directory. Chmod requires an understanding of how the read-write-execute permissions are expressed. The "list long" command (ls -l) displays the attributes of a file or directory, and the first part of the line looks like this: -rwxrwxrwx. A dash or "d" as the first character means file or directory. The three sets of rwx are permissions for owner-group-other. For example, -rwxrw-r-- gives all permissions to the file on the line to the owner, read/write permissions to the group and read only for the rest.

The command uses =, + and - to set, add and subtract changes to owner (u), group (g), other (o) or all (a). The following examples show the permissions of an abc.sh shell script after each command is executed. See ls, shell script, chown and chgrp.

-rwxrwxrwx ALL PERMISSIONS

chmod o= abc.sh SET OTHER TO NONE

-rwxrwx---

chmod o+r abc.sh ADD R TO OTHER

-rwxrwxr--

chmod a-x abc.sh REMOVE ALL EXECUTE

-rw-rw-r--

chmod a=rwx abc.sh SET ALL TO RWX

-rwxrwxrwx

chmod a= abc.sh SET ALL TO NON

----------

chmod u=r abc.sh SET OWNER TO READ

-r--------

List Long Shows Permissions

The list long (ls -l) command shows the permissions of files and directories (folders). The arrow points to the permissions in this Mac OS X example (X stands for Unix).

THESE COPYRIGHTED DEFINITIONS ARE FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.

12 issues for $19.99ONLY $1.67 an issue!

24 issues for $29.99 ONLY $1.25 an issue! Lock in Your Savings!

State

Country

Automatic Renewal Program: Your subscription will continue without interruption for as long as you wish, unless
you instruct us otherwise. Your subscription will automatically renew at the end of the term unless you authorize
cancellation. Each year, you'll receive a notice and you authorize that your credit/debit card will be charged the
annual subscription rate(s). You may cancel at any time during your subscription and receive a full refund on all
unsent issues. If your credit/debit card or other billing method can not be charged, we will bill you directly instead. Contact Customer Service