Linux Commands Reference - Complete Linux Command Guide
Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.
chmod
Change file permissions
Syntax
chmod [OPTION]... MODE[,MODE]... FILE...Common Options
-RRecursive change-vVerbose output-cReport only if changes made-fSuppress error messages--referenceUse reference file permissions-uSet user permissions-gSet group permissions-oSet others permissions-XSet execute only for directories-sSet SUID/SGID bits-tSet sticky bit--preserve-rootPrevent recursive change on rootCommon Examples
chmod 755 file.shSet rwxr-xr-x permissions
chmod 644 file.txtSet rw-r--r-- permissions
chmod 777 directory/Set rwxrwxrwx permissions
chmod 700 private.keySet rwx------ permissions
chmod +x script.shAdd execute permission
chmod -R 644 directory/Set permissions recursively
chmod u=rwx,g=rx,o=r fileSymbolic mode
chmod 4755 programSet SUID bit
Numeric Permission Mode
Permission Calculation
Each permission is represented by a number: read(r)=4, write(w)=2, execute(x)=1. Add them up for each position.
Three-Digit Format
First digit=owner, second=group, third=others. e.g., 755 = owner 7(rwx), group 5(r-x), others 5(r-x)
Common Numeric Modes
| Numeric | Permission | Description |
|---|---|---|
777 | rwxrwxrwx | Full access for everyone (use with caution) |
755 | rwxr-xr-x | Owner full access, others read/execute (default for executables) |
744 | rwxr--r-- | Owner full access, others read-only |
700 | rwx------ | Owner only (private keys, configs) |
644 | rw-r--r-- | Owner read/write, others read-only (default for files) |
640 | rw-r----- | Owner read/write, group read, others none |
600 | rw------- | Owner only (sensitive files) |
555 | r-xr-xr-x | Everyone read/execute (immutable executables) |
511 | r-x--x--x | Everyone execute, only owner can read |
444 | r--r--r-- | Everyone read-only |
400 | r-------- | Owner read-only |
000 | --------- | No permissions |
Special Permission Bits
Optional fourth digit: 4=SUID, 2=SGID, 1=Sticky bit
Related Tools
More Code & Dev Tools
Git Commit Message Generator
Generate standardized Git commit messages following Conventi...
Color Shades & Tints Generator
Generate shades, tints, and tones from any base color. Expor...
Nginx Config Generator
Generate Nginx configuration files visually. Support static ...
Color Extractor
Extract colors from images online. Get dominant colors and c...
Code Analyzer
Analyze code quality online. Check for errors, warnings, and...
Code Formatter
Format and beautify code online. Support multiple languages ...
JavaScript Formatter
Format and beautify JavaScript code online. Improve code rea...
cURL Converter
Convert cURL commands to Python, JavaScript, PHP, Go, and mo...
Cron Expression Generator
Generate and validate Cron expressions online. Convert Cron ...
Timestamp Batch Converter
Convert multiple timestamps at once. Batch process Unix time...
API Tester
Test HTTP APIs online with support for GET, POST, PUT, DELET...
HTTP Header Analyzer
Analyze HTTP response headers. Check security headers, CORS ...