sudo

अनुमतियाँ

इस्तेमाल

sudo [cmd]

एक command को दूसरे उपयोगकर्ता, डिफ़ॉल्ट रूप से root, के रूप में चलाता है; sudo cmd > file में > आपके ही shell से खुलता है, इसलिए root की फ़ाइल पर वह विफल रहता है और वहाँ tee काम आता है।

आम विकल्प

विकल्पअर्थ
-uRun as another user instead of root
-iStart a login shell with that user environment
-sStart a shell but keep your own environment
-EKeep your environment variables, if the policy allows it
-kForget the cached password right now
-lList what you are allowed to run
-vRefresh the timestamp without running anything

उदाहरण

sudo -u postgres psql

Runs the client as the postgres user.

sudo -i

A root login shell, with root PATH and environment.

echo text | sudo tee -a /etc/hosts

Redirection 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