sudo
अनुमतियाँ
इस्तेमाल
sudo [cmd]एक command को दूसरे उपयोगकर्ता, डिफ़ॉल्ट रूप से root, के रूप में चलाता है; sudo cmd > file में > आपके ही shell से खुलता है, इसलिए root की फ़ाइल पर वह विफल रहता है और वहाँ tee काम आता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -u | Run as another user instead of root |
| -i | Start a login shell with that user environment |
| -s | Start a shell but keep your own environment |
| -E | Keep your environment variables, if the policy allows it |
| -k | Forget the cached password right now |
| -l | List what you are allowed to run |
| -v | Refresh the timestamp without running anything |
उदाहरण
sudo -u postgres psqlRuns the client as the postgres user.
sudo -iA root login shell, with root PATH and environment.
echo text | sudo tee -a /etc/hostsRedirection needs tee, because > runs as you.
संख्या मोड और अक्षर मोड एक ही चीज़ कहते हैं: 755 और u=rwx,go=rx एक ही अनुमति है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. sudo क्या करता है?
एक command को दूसरे उपयोगकर्ता, डिफ़ॉल्ट रूप से root, के रूप में चलाता है; sudo cmd > file में > आपके ही shell से खुलता है, इसलिए root की फ़ाइल पर वह विफल रहता है और वहाँ tee काम आता है।
Q. इसे कैसे लिखें?
sudo [cmd] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 7 दिए हैं; पूरी सूची man sudo में है। यह कमांड अनुमतियाँ में आती है।
मिलती-जुलती कमांड
man पेज: man sudo