Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chmod(1) — Ultrix-11 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chown(1)

ls(1)

chmod(2)

stat(2)

umask(2)

chmod(1)

NAME

chmod − change mode of a file

SYNTAX

chmod mode file... 

DESCRIPTION

The chmod command changes the permission settings of each named file to mode.  The mode can be absolute or symbolic.  An absolute mode is an octal number constructed from the OR of the following modes:

4000 set user ID on execution

2000 set group ID on execution

1000 sticky bit, see chmod(2)

0400 read by owner

0200 write by owner

0100 execute (search in directory) by owner

0040 group read permission

0020 group write permission

0010 group execute permission

0004 other read permission

0002 other write permission

0001 other execute permission

A symbolic mode has the form:

[who] op permission [op permission] ...

The who is a combination of the letters u (for user’s permissions), g (group) and o (other).  The letter a stands for ugo.  If who is omitted, the default is a but the setting of the file creation mask is taken into account.  For further information see umask(2). 

The op can be + to add permission to the file’s mode, − to take away permission and = to assign permission absolutely.  All other bits will be reset. 

The permission is any combination of the letters r (read), w (write), x (execute), s (set owner or group id) and t (save text − sticky).  Letters u, g or o indicate that permission is to be taken from the current mode.  Omitting permission is only useful with = to take away all permissions. 

The first example denies write permission to others, the second makes a file executable:

chmod o−w file
chmod +x file

Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter s is only useful with u or g. 

Only the owner of a file or the superuser may change its mode. 

SEE ALSO

chown(1), ls(1), chmod(2), stat(2), umask(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026