Syntax

You can change the modes of directories and files in the MapR storage using either the hadoop fs command with the -chmod option, or using the chmod command via NFS. The syntax for both commands is similar:

  • hadoop fs -chmod [-R] <MODE>[,<MODE>]... | <OCTALMODE> <URI> [<URI> ...]
  • chmod [-R] <MODE>[,<MODE>]... | <OCTALMODE> <URI> [<URI> ...]

Parameters and Options

The following table provides the command parameters and options with their descriptions:

Parameter/Option

Description

-R

If specified, this option applies the new mode recursively throughout the directory structure.

MODE

A string that specifies a mode.

OCTALMODE

A three-digit octal number that specifies the new mode for the file or directory.

URI

A relative or absolute path to the file or directory for which to change the mode.

Examples

The following examples are all equivalent:

  • chmod 755 script.sh
  • chmod u=rwx,g=rx,o=rx script.sh
  • chmod u=rwx,go=rx script.sh