TotalNET Advanced Server 5.2 Reference Manual

tnchown

This command sets the user ID of a file or a directory to a specified owner and changes TAS shadow file user ID information of that file or directory to reflect the new ID. Only the owner of the file or directory and the superuser root may change the owner of a file or directory. You can specify the owner as either the user name or the user ID.

Location

TNHOME/usr/bin

Usage

tnchown [-f] [-i] [-R] owner {file...|dir...}

Options

-f 

Use the command without allowing it to print error messages even if the operation fails to change the owner. 

-i 

Prompt for confirmation before the owner of a file or directory changes. 

-R 

Change the owner of a directory and all files and directories under that directory, and change the shadow file information on each affected file or directory. 

owner 

Specify the new owner. 

file 

Specify the file. 

dir 

Specify the directory. 

Examples

  1. Use the following command to change the owner of the file tnarch.doc to the user jeremy:


    tnchown jeremy tnarch.doc
  2. Use the following command to change the owner of the files status.doc and schedule.doc and the directory engineer to user ID 269:


    tnchown 269 status.doc schedule.doc engineer
  3. Use the following command to change the owner of tadmin.jpeg to user matt without getting an error message even if the command fails:


    tnchown -f matt tadmin.jpeg
  4. Use the following command to change the owner of schedule.ppt to user jacque and prompt for confirmation:


    tnchown -i jacque schedule.ppt
  5. Use the following command to change the owner of the directory marketing and all files and directories under it to user diane:


    tnchown -R diane marketing