TotalNET Advanced Server 5.2 Reference Manual

tnchmod

This command allows you to change or assign the mode of a file or a directory in a manner similar to that of the UNIX chmod command, as well as change the mode of the corresponding TAS shadow file for the specified file or directory. For more information, refer to the chmod man page.

Location

TNHOME/usr/bin

Usage

tnchmod [-f] [-i] [-R] absolute-mode {file...|dir...}
tnchmod [-f] [-i] [-R] symbolic-mode-list {file...|dir...}

Options

-f

Use this command without allowing it to print error messages, even when the operation fails to change the mode. 

-i

Prompt for confirmation before the mode changes. 

-R

Change the mode of a directory and all files or directories under that directory, and change the shadow file information for the files and directories. 

absolute-mode

Specify a four-digit octal mode. 

file

Specify a file. 

dir

Specify a directory. 

symbolic-mode-list

Specify a list of symbolic expressions in the following form, where who represents the characters u, g, o, and/or a; operator specifies the way you want permissions to change, with +, -, or =; and permissions represents any compatible combination of r, w, x, l, s, and t: 

[who] operator [permissions] 

Examples

  1. Use the following command to change the mode of the file userlist.doc to "read" and "write" permissions for the owner and "read-only" permissions for others:


    tnchmod 644 userlist.doc
  2. Use the following command to add "write" permissions for everyone to the files present.doc and schedule.doc and the directory mgmt:


    tnchmod a+w present.doc schedule.doc mgmt
  3. Use the following command to change the permission of the file log.nw to 777 without receiving any error messages:


    tnchmod -f 777 log.nw
  4. Use the following command to change the permission of the file testplan.doc to 777 and prompt for confirmation before the mode changes:


    tnchmod -i 777 testplan.doc
  5. Use the following command to change the mode of the directory marketing, and all files and directories under it, to "read" and "write" permissions for everyone:


    tnchmod -R a+r+w marketing