Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Commands:  chgrp(1)

chmod(1)

passwd(1)

/chfn(1)

/chsh(1)

Functions:  chown(2)

chmod(2)

Files:  passwd(4)

Standards:  standards(5)

chown(1)  —  Commands

NAME

chown − Changes the owner of files or directories

SYNOPSIS

chown [−fhR] owner[:group] file ... 

The chown command changes the owner of the specified files or directories to the specified user name or user ID. 

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

chown:  XPG4, XPG4−UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags. 

FLAGS

−f[Digital]  Turns off error reporting. 

−h[Digital]  If file is a symbolic link, chown −h file changes the owner of the symbolic link. The chown file format changes the owner of the file referenced by the symbolic link. 

−RDescends recursively through its directory arguments, setting the specified owner. 

PARAMETERS

fileThe pathname of the file for which ownership is to be changed. 

owner[:group]A user ID and optional group ID to be assigned to file. The owner portion of this operand must be a user name from the user database or a numeric user ID. Either specifies a user ID to be given to each file named by one of the file parameters. If a numeric owner operand exists in the user database as a user name, the user ID number associated with that user name will be used as the user ID. 

If the group portion of this operand is present, it must be a group name from the group database or a numeric group ID.  Either specifies a group ID to be given to each file. If a numeric group operand exists in the group database as a group name, the group ID number associated with that group name will be used as the group ID. 

DESCRIPTION

[Digital]  Only a user with superuser authority can use the chown command. 

The owner argument must be a valid user name or a valid numerical user ID.  The optional group argument must be a valid group name or a valid numerical group ID. 

ENVIRONMENT VARIABLES

The following environment variables affect the execution of chown:

LANGProvides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. 

LC_ALLIf set to a non-empty string value, overrides the values of all the other internationalization variables. 

LC_CTYPEDetermines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). 

LC_MESSAGESDetermines the locale for the format and contents of diagnostic messages written to standard error. 

NLSPATHDetermines the location of message catalogues for the processing of LC_MESSAGES. 

EXAMPLES

To change the owner of the file program.c, enter:

chown  steffan  program.c

The user access permissions for program.c now apply to steffan.  As the owner, steffan can use the chmod command to permit or deny the other users access to program.c.  See the chmod command for details. 

EXIT VALUES

The following exit values are returned:

0The chown command executed successfully and all requested changes have been made. 

>0An error occurred

FILES

/etc/passwdContains user names and numeric user IDs. 

RELATED INFORMATION

Commands:  chgrp(1), chmod(1), passwd(1)/chfn(1)/chsh(1)

Functions:  chown(2), chmod(2)

Files:  passwd(4)

Standards:  standards(5)

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