system enabled verified low v1.0.0

chmod

Change file mode bits

📋 Live Preview
chmod -c {changes} -f {silent} -v {verbose} -h {no-dereference} -R {recursive}
๐Ÿ“Ž changes ๐Ÿ“Ž silent ๐Ÿ“Ž verbose ๐Ÿ“Ž no-dereference ๐Ÿ“Ž recursive
chmod -c {changes} -f {silent} -v {verbose} -h {no-dereference} -R {recursive}

Sandbox: execFile · Timeout: 30s

Capabilities

system.file.chmod
system.file.search
system.file.process
system.file.copy
system.file.move
system.file.delete

Parameters

Name Type Required Default Description Aliases
changes string No - like verbose but report only when a change is made -c, --changes
silent string No - suppress most error messages -f, --silent, --quiet
verbose string No - output a diagnostic for every file processed --dereference affect the referent of each symbolic link, rather than the symbolic link itself -v, --verbose
no-dereference string No - affect each symbolic link, rather than the referent --no-preserve-root do not treat '/' specially (the default) --preserve-root fail to operate recursively on '/' --reference=RFILE use RFILE's mode... -h, --no-dereference
recursive string No - change files and directories recursively -R, --recursive
flag-H file No - if a command line argument is a symlink to a directory, traverse it -H
flag-L file No - traverse every symbolic link to a directory encountered -L
flag-P string No - do not traverse any symbolic links -P
help string No - display this help and exit --version output version information and exit --help
dereference boolean No - --dereference
no_preserve_root boolean No - --no-preserve-root
preserve_root boolean No - --preserve-root
reference boolean No - --reference
version boolean No - --version

Examples

Basic usage with changes

chmod ${changes}

Display help message

chmod --help

Give the [u]ser who owns a file the right to e[x]ecute it.

chmod u+x PATH

Give the [u]ser rights to [r]ead and [w]rite to a file/directory.

chmod u+rw PATH

Remove e[x]ecutable rights from the [g]roup.

chmod g-x PATH

Give [a]ll users rights to [r]ead and e[x]ecute.

chmod a+rx PATH

Give [o]thers (not in the file owner's group) the same rights as the [g]roup.

chmod o=g PATH

Remove all rights from [o]thers.

chmod o= PATH

Change permissions recursively, allowing [g]roup and [o]thers to [w]rite.

chmod -R g+w,o+w PATH

Set access rights using numeric (octal) form.

chmod 750 PATH

Add the execute permission bit to directories only. This works because the 'X' is uppercase, meaning only directories will be executable. However, if an existing file is executable, this bit will not be removed.

chmod a+X PATH

Convert string representation of the access right into numeric form and back.

curl cheat.sh/chmod/750

cheat.sheets: chmod

curl cheat.sh/chmod/rwxr-x

Documentation


chmod โ€” Change file mode bits

Overview

chmod is a command-line utility for change file mode bits.

Usage

chmod -c {changes} -f {silent} -v {verbose} -h {no-dereference} -R {recursive}

Related Tools

system-file-chown