SUT Home

ptchown

SUT chown

Description

ptchown changes the owner and group of a list of files on specified hosts.

Command Line Arguments

ptchown [-m <machine_file>|-M <machine_list>] [-Rfh] <user>[:<group>] <file1> [<file2> <file3>...]

-m <machine_file>
Specify a file with a list of destination machines. It is incorrect to use this with the -M option. This option must preceed all others.

-M <machine_list>
Specify a list of destination machines. The entire list must be surrounded by quotes. It is incorrect to use this with the -m option. This option must preceed all others.
-R
change ownership recursively
-f
suppress error messages
-h
change the ownership of symbolic links instead of the files to which they point
user
the username of the new owner of the files
group
the groupname of the new group of the files (optional)
<file1> [<file2> <file3>...]
the list of files to reown

Environment Variables

PT_MACHINE_FILE
If PT_MACHINE_FILE is set, the command will attempt to open the file whose name is stored in PT_MACHINE_FILE. This will be used if neither the -m or -M options are given.

Examples

To change the owner of a file "myfile" to johndoe on the machines specified in the file "destination_machines" use

ptchown -m destination_machines johndoe myfile

To make the same change, specifying the machines on the command line, use

ptchown -M "host1 host2 host3" johndoe myfile

To change the owner and group of all files and directories starting with 'r' in directory "/home/johndoe/project" to root and root, use

ptchown -m destination_machines -R root:root "/home/johndoe/project/r*"

See Also

chown(1), SUT(1)







Contact Emil Ong about issues concerning this page.