$ chmod 755 script.sh # Executable script — owner can edit, others can run
chmod 644 config.conf # Config file — owner can edit, others read-only
chmod 600 .ssh/id_rsa # Private key — owner only, no one else
chmod 777 /tmp/shared # Fully open (use sparingly, never on production)
chmod 700 ~/scripts/ # Private directory — owner only
chmod 755 script.sh # Executable script — owner can edit, others can run
chmod 644 config.conf # Config file — owner can edit, others read-only
chmod 600 .ssh/id_rsa # Private key — owner only, no one else
chmod 777 /tmp/shared # Fully open (use sparingly, never on production)
chmod 700 ~/scripts/ # Private directory — owner only
chmod 755 script.sh # Executable script — owner can edit, others can run
chmod 644 config.conf # Config file — owner can edit, others read-only
chmod 600 .ssh/id_rsa # Private key — owner only, no one else
chmod 777 /tmp/shared # Fully open (use sparingly, never on production)
chmod 700 ~/scripts/ # Private directory — owner only
# Apply 755 to all directories, 644 to all files
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;
# Apply 755 to all directories, 644 to all files
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;
# Apply 755 to all directories, 644 to all files
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;
chmod -R 755 /var/www/html
chmod -R 755 /var/www/html
chmod -R 755 /var/www/html
ls -la filename # Single file
stat filename # Verbose output including octal
ls -la /path/to/dir/ # Directory listing
ls -la filename # Single file
stat filename # Verbose output including octal
ls -la /path/to/dir/ # Directory listing
ls -la filename # Single file
stat filename # Verbose output including octal
ls -la /path/to/dir/ # Directory listing
stat -c "%a" filename # Just the octal number
stat -c "%a" filename # Just the octal number
stat -c "%a" filename # Just the octal number - The chmod octal command (chmod 755 filename)
- The symbolic command (chmod u=rwx,g=rx,o=rx filename)
- A plain-English explanation of what those permissions mean - 7 = owner gets rwx (read + write + execute)
- 5 = group gets r-x (read + execute, no write)
- 5 = others get r-x