{
    "mode": "perldoc",
    "parameter": "chmod",
    "section": "-f",
    "url": "https://www.chedong.com/phpMan.php/perldoc/chmod/json",
    "generated": "2026-06-03T02:31:42Z",
    "sections": [],
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Change the access permissions of a file or directory.",
        "examples": [
            {
                "description": "Give the [u]ser who owns a file the right to e[x]ecute it",
                "command": "chmod u+x {{path/to/file}}"
            },
            {
                "description": "Give the [u]ser rights to [r]ead and [w]rite to a file/directory",
                "command": "chmod u+rw {{path/to/file_or_directory}}"
            },
            {
                "description": "Remove e[x]ecutable rights from the [g]roup",
                "command": "chmod g-x {{path/to/file}}"
            },
            {
                "description": "Give [a]ll users rights to [r]ead and e[x]ecute",
                "command": "chmod a+rx {{path/to/file}}"
            },
            {
                "description": "Give [o]thers (not in the file owner's group) the same rights as the [g]roup",
                "command": "chmod o=g {{path/to/file}}"
            },
            {
                "description": "Remove all rights from [o]thers",
                "command": "chmod o= {{path/to/file}}"
            },
            {
                "description": "Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite",
                "command": "chmod {{-R|--recursive}} g+w,o+w {{path/to/directory}}"
            },
            {
                "description": "Recursively give [a]ll users [r]ead permissions to files. Also give e[X]ecute permissions to files that have at least one execution permission and to all sub-directories",
                "command": "chmod {{-R|--recursive}} a+rX {{path/to/directory}}"
            }
        ]
    }
}