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
Color Converter
Convert between HEX, RGB, HSL color formats. Color picker wi...
Code Analyzer
Analyze code quality online. Check for errors, warnings, and...
Timestamp Batch Converter
Convert multiple timestamps at once. Batch process Unix time...
SQL Formatter
Format and beautify SQL queries online. Improve SQL readabil...
JavaScript Formatter
Format and beautify JavaScript code online. Improve code rea...
cURL Converter
Convert cURL commands to Python, JavaScript, PHP, Go, and mo...
WebSocket Tester
Test WebSocket connections and messages in real-time. Connec...
Color Contrast Checker
Check color contrast ratios for WCAG compliance. Ensure acce...
Code Minifier
Minify HTML, CSS, and JavaScript code. Reduce file size by r...
HTML Formatter
Format and minify HTML online. Beautify HTML code or compres...
HTTP Status Codes
Reference guide for HTTP status codes. Learn the meaning of ...
Port Checker
Check if a port is open online. Test port availability and c...