Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chmod(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ls(1)

chmod(2)

cdf(4)

CHMOD(1)  —  HP-UX

NAME

chmod − change mode

SYNOPSIS

chmod mode file ... 

DESCRIPTION

The permissions of any named file are changed according to mode, which 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

0070: read, write, execute (search) by group

0007: read, write, execute (search) by others

A symbolic mode has the form:

[ who ] op permission [ op permission ]

The who part is a combination of the letters u (for user’s permissions), g (group) and o (other).  The letter a stands for ugo, the default if who is omitted. 

Op can be + to add permission to the file’s mode, − to take away permission, or = to assign permission absolutely (all other bits will be reset). 

Permission is any combination of the letters r (read), w (write), x (execute), s (set owner or group ID), and t (save text or sticky); 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. 

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

Only the owner of a file (or the super-user) can change its mode.  Only the super-user can set the sticky bit.  In order to set the group ID, the group of the file must correspond to your current group ID. 

When using chmod on a symbolic link, the mode of the file referred to by the link is changed. 

EXAMPLES

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

chmod o−w file

chmod +x file

The third example assigns read and execute permission to everybody, and sets the set-user-ID bit.  The fourth assigns read and write permission to the file owner, and read permission to everybody else:

chmod 4555 file

chmod 644 file

DEPENDENCIES

Series 300 Diskless
The absolute mode of 4000 also serves to hide a directory.  For symbolic mode, the permission letter H is used to hide a directory (see cdf(4)). 

AUTHOR

Chmod was developed by AT&T and HP. 

SEE ALSO

ls(1), chmod(2), cdf(4). 

INTERNATIONAL SUPPORT

8-bit file names. 

Hewlett-Packard Company  —  May 11, 2021

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