chmod
अनुमतियाँ
इस्तेमाल
chmod 755 [path]फ़ाइलों और डायरेक्टरियों के अनुमति bits तय करता है; chmod -R 755 सामान्य फ़ाइलों को भी executable बना देता है, इसलिए फ़ाइलें छोड़नी हों तो बड़ा X इस्तेमाल करें।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| 0755 | Numeric: owner, group, others, each read 4 + write 2 + execute 1 |
| u+w | Symbolic: who (u g o a), then + - =, then r w x |
| +x | Add the execute bit, the usual fix for a script |
| -R | Apply to a whole tree |
| +X | Execute for directories only, never for plain files |
| -v | Name each file whose mode changed |
| -h | BSD and macOS: change the symlink itself, not its target |
उदाहरण
chmod +x deploy.shMakes the script runnable.
chmod -R u+rwX,go+rX,go-w site/Capital X keeps files non-executable.
chmod 600 ~/.ssh/id_ed25519What ssh insists on for a private key.
संख्या मोड और अक्षर मोड एक ही चीज़ कहते हैं: 755 और u=rwx,go=rx एक ही अनुमति है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. chmod क्या करता है?
फ़ाइलों और डायरेक्टरियों के अनुमति bits तय करता है; chmod -R 755 सामान्य फ़ाइलों को भी executable बना देता है, इसलिए फ़ाइलें छोड़नी हों तो बड़ा X इस्तेमाल करें।
Q. इसे कैसे लिखें?
chmod 755 [path] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 7 दिए हैं; पूरी सूची man chmod में है। यह कमांड अनुमतियाँ में आती है।
मिलती-जुलती कमांड
man पेज: man chmod