$ chmod
Change file mode bits
DOCUMENTEDPermissionsUbuntu 24.04 LTS baseline
Use care. This command changes file permission bits. Incorrect permissions can prevent applications or users from accessing files, or expose files more broadly than intended.
Synopsis
chmod [OPTION]... MODE[,MODE]... FILE...
What it does
- `chmod` changes permission bits on files.
- Symbolic modes use classes such as `u`, `g`, `o`, and `a`; numeric modes represent read/write/execute bits.
Examples
Add execute permission for the owner
chmod u+x script.shSet common executable-file permissions
chmod 755 script.shRemove write permission from others
chmod o-w file.txtImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.