*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> chown (1)              
Title
Content
Arch
Section
 

Contents


chown(1)							      chown(1)


NAME    [Toc]    [Back]

     chown, chgrp - change owner or group

SYNOPSIS    [Toc]    [Back]

     chown [ -Rfh ] owner[{.|:}group] file ...

     chgrp [ -Rfh ] group file ...

DESCRIPTION    [Toc]    [Back]

     chown changes the owner of	the files to owner.  The owner may be either a
     login name	found in the password file, or a decimal user ID.  An optional
     group, separated from the owner by	either a period	or a colon, may	also
     be	specified.  The	group may be either a group name found in the group
     file, or a	decimal	group ID.

     chgrp changes the group ID	of the files to	group.	The group may be
     either a group name found in the group file, or a decimal group ID.

     No	errors,	except for usage errors, are reported when the -f (force)
     option is given.

     When the -R option	is given, the command recursively descends its
     directory arguments setting the specified owner or	group.	When symbolic
     links are encountered and the -h option is	not given, they	are traversed
     and the owner/group of the	file referenced	by the symbolic	link is
     changed.

     When the -h option	is given and the file is a symbolic link, change the
     owner/group of the	symbolic link.	Without	this option, the owner/group
     of	the file referenced by the symbolic link is changed.

     If	either command is invoked by other than	the superuser, the set-user-ID
     and set-group-ID bits of the file mode, 04000 and 02000 respectively,
     will be cleared.

     Only the owner of a file (or the superuser) may change the	owner or group
     of	that file.

     However, if the variable restricted_chown is enabled (see intro(2)	and
     systune(1M)) then only the	superuser can change the owner of the file,
     because if	users were able	to give	files away, they could defeat the file
     space accounting procedures.  The owner of	the file may change the	group
     ownership only to those groups of which he	is a member.

FILES    [Toc]    [Back]

     /etc/passwd
     /etc/group

NOTES    [Toc]    [Back]

     Because chown uses	a depth-first algorithm	to recursively descend its
     directory arguments, there	is a limitation	to how deep it can descend
     which is dependent	on the number of file descriptors available to a given



									Page 1






chown(1)							      chown(1)



     shell.  find(1) can be used if one	needs to descend deeper	than a given
     configuration will	allow.

SEE ALSO    [Toc]    [Back]

      
      
     chmod(1), find(1),	chown(2), group(4), passwd(4), stat(4).

DIAGNOSTICS    [Toc]    [Back]

     chown and chgrp will exit with a status of	0 if all file operations
     completed successfully.  If there are any failures, the exit status will
     be	> 0.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
lchown FreeBSD change owner and group of a file
fchown FreeBSD change owner and group of a file
lchown Tru64 Change the owner and group IDs of a file
fchown Tru64 Change the owner and group IDs of a file
chown IRIX change owner and group of a file
chown Tru64 Change the owner and group IDs of a file
chown FreeBSD change file owner and group
fchown HP-UX change owner and group of a file
chown HP-UX change owner and group of a file
chown OpenBSD change file owner and group
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service