chmod +x <file>Makes a file executable.
Example
chmod +x exploit.shChanges file permissions using symbolic or octal modes, including setuid, setgid and sticky bits.
sudo apt install coreutilschmod +x <file>Makes a file executable.
Example
chmod +x exploit.shchmod u+x <file>Executable for the owner only.
Example
chmod u+x run.shchmod go-rwx <file>Removes all access for group and others.
Example
chmod go-rwx id_rsachmod a+r <file>Readable by everyone.
Example
chmod a+r index.htmlchmod u=rw,go=r <file>Sets exact permissions per class.
Example
chmod u=rw,go=r notes.txtchmod 644 <file>rw-r--r--: owner reads and writes, everyone else reads. Typical for files.
Example
chmod 644 index.htmlchmod 755 <dir>rwxr-xr-x: typical for directories and scripts.
Example
chmod 755 /var/www/htmlchmod 600 <file>rw-------: private keys must be this strict or SSH refuses them.
Example
chmod 600 ~/.ssh/id_ed25519chmod 700 <dir>Only the owner can enter or list.
Example
chmod 700 ~/.sshchmod u+s <file>Sets SUID: the program runs with its owner’s privileges. Dangerous on root-owned binaries.
Example
chmod u+s /usr/local/bin/toolchmod g+s <dir>SGID on a directory: new files inherit the directory’s group.
Example
chmod g+s /srv/sharedchmod +t <dir>Sticky bit: users can delete only their own files, as in /tmp.
Example
chmod +t /srv/uploadchmod 4755 <file>Octal SUID plus 755. The leading digit is 4 for SUID, 2 for SGID and 1 for sticky.
chmod -R <mode> <dir>Applies a mode to a whole tree.
Example
chmod -R go-w /var/wwwfind <dir> -type d -exec chmod 755 {} +Sets directories and files differently — usually what you want instead of chmod -R.
Example
find /var/www -type d -exec chmod 755 {} +find <dir> -type f -exec chmod 644 {} +Sets every file to 644.
Example
find /var/www -type f -exec chmod 644 {} +chmod --reference=<ref> <file>Copies permissions from another file (GNU).
Example
chmod --reference=good.conf broken.confChanges the owner and group of files and directories.
Lists directory contents with sizes, permissions, owners, timestamps and hidden files.
Searches the directory tree by name, type, size, time, owner or permissions — and runs actions on matches.
Creates directories, including parent paths and with specific permissions.