Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hi] Add content/hi/docs/tasks/tools/included/optional-kubectl-confi… #30627

Merged
merged 8 commits into from
Nov 28, 2021
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Linux पर bash ऑटो-कम्पलीशन"
description: "Linux पर bash ऑटो-कम्पलीशन के लिए कुछ वैकल्पिक विन्विन्यास।"
headless: true
---

## परिचय

Bash के लिए kubectl कम्प्लिशन स्क्रिप्ट `kubectl completion bash` कमांड के साथ उत्पन्न की जा सकती है। आपके शेल में कम्प्लिशन स्क्रिप्ट को सोर्स करने से kubectl ऑटोकम्प्लिशन ऐनेबल हो जाती है।
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd want to use a fixed spelling for completion : here we have used कम्पलीशन and कम्प्लिशन both. I suggest going forward with कम्पलीशन


हालाँकि, कम्प्लिशन की स्क्रिप्ट [**bash-completion**](https://github.com/scop/bash-completion) पर निर्भर करती हैं जिसका अर्थ है कि आपको पहले इस सॉफ़्टवेयर को स्थापित करना होगा (आप `type _init_completion` चलाकर परीक्षण कर सकते हैं कि आपने पहले से bash-completion इंस्टॉल की है या नहीं)।

## Bash-completion को इंस्टॉल करें

कई पैकेज मैनेजर द्वारा bash-completion प्रदान की जाती है ([यहाँ](https://github.com/scop/bash-completion#installation) देखें)। आप इसे `apt-get install bash-completion` या `yum install bash-completion` आदि के साथ इंस्टॉल कर सकते हैं।
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use either इंस्टॉल or स्थापित. Using both of them will be unnecessary across the document. Please make amends.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will update.


यह कमांड `/usr/share/bash-completion/bash_completion` उत्त्पन्न करता है, जो bash-completion की मुख्य स्क्रिप्ट है। आपके पैकेज मैनेजर के आधार पर, आपको इस फाइल को अपनी `~/.bashrc` फाइल में मैन्युअल रूप से सोर्स करना होगा।

यह पता लगाने के लिए, अपना शेल पुनः लोड करें और `type _init_completion` रन करे। यदि कमांड सफल होता है, तो आप पहले से ही सेट हैं, अन्यथा अपनी `~/.bashrc` फ़ाइल में निम्नलिखित जोड़ें:
```bash
source /usr/share/bash-completion/bash_completion
```

अपना शेल पुनः लोड करें और `type _init_completion` टाइप करके सत्यापित करें कि bash-completion सही ढंग से इंस्टॉल है।

## kubectl ऑटोकम्प्लिशन ऐनेबल करे

अब आपको यह सुनिश्चित करने की आवश्यकता है कि Kubectl कम्प्लिशन स्क्रिप्ट आपके सभी शेल सत्रों (sourced) में प्राप्त हो जाए। आप ऐसा दो तरीकों से कर सकते हैं:

- अपनी `~/.bashrc` फ़ाइल में कम्प्लिशन स्क्रिप्ट सॉर्स करें:

```bash
echo 'source <(kubectl completion bash)' >>~/.bashr
```
- कम्प्लिशन स्क्रिप्ट को `/etc/bash_completion.d` डायरेक्टरी में जोड़ें:
```bash
kubectl completion bash >/etc/bash_completion.d/kubectl
```


यदि आप के पास kubectl के लिए एक अन्य नाम (alias) है, तो आप उस अन्य नाम के साथ काम करने के लिए शेल कम्प्लिशन को बढ़ा सकते हैं:
```bash
echo 'alias k=kubectl' >>~/.bashrc
echo 'complete -F __start_kubectl k' >>~/.bashrc
```
{{< note >}}
bash-completion सभी कम्प्लिशन स्क्रिप्ट को `/etc/bash_completion.d` में सोर्स करता है।
{{< /note >}}

दोनों दृष्टिकोण बराबर हैं। आपके शेल को पुनः लोड करने के बाद, Kubectl ऑटोकम्प्लिशन कार्य करना शुरू कर देगा।