उपयोगी लिनक्स कमांड लाइन बैश शॉर्टकट आपको पता होना चाहिए


इस लेख में, हम किसी भी लिनक्स उपयोगकर्ता के लिए उपयोगी कई बैश कमांड-लाइन शॉर्टकट साझा करेंगे। ये शॉर्टकट आपको आसानी से और तेज़ तरीके से, कुछ गतिविधियों को करने की अनुमति देते हैं जैसे कि पहले से निष्पादित कमांड को एक्सेस करना और चलाना, एक कमांड खोलना, कमांड लाइन पर टेक्स्ट को एडिट/डिलीट करना/बदलना, कर्सर को ले जाना, कमांड पर प्रक्रियाओं को नियंत्रित करना आदि। लाइन।

यद्यपि यह लेख ज्यादातर लिनक्स शुरुआती को कमांड लाइन मूल बातें के साथ अपना रास्ता बनाने में लाभान्वित करेगा, मध्यवर्ती कौशल और उन्नत उपयोगकर्ताओं के साथ वे भी इसे व्यावहारिक रूप से उपयोगी पा सकते हैं। हम निम्नानुसार श्रेणियों के अनुसार बैश कीबोर्ड शॉर्टकट को समूहीकृत करेंगे।

एक संपादक लॉन्च करें

एक टर्मिनल खोलें और खाली बफर के साथ एक संपादक ( नैनो संपादक ) खोलने के लिए Ctrl + X और Ctrl + E दबाएं। बैश पर्यावरण चर द्वारा परिभाषित संपादक को लॉन्च करने का प्रयास करेगा।

स्क्रीन पर नियंत्रण

ये शॉर्टकट टर्मिनल स्क्रीन आउटपुट को नियंत्रित करने के लिए उपयोग किए जाते हैं:

  • Ctrl+L – clears the screen (same effect as the “clear” command).
  • Ctrl+S – pause all command output to the screen. If you have executed a command that produces verbose, long output, use this to pause the output scrolling down the screen.
  • Ctrl+Q – resume output to the screen after pausing it with Ctrl+S.

कमांड लाइन पर कर्सर ले जाएँ

कमांड-लाइन के भीतर कर्सर ले जाने के लिए अगले शॉर्टकट का उपयोग किया जाता है:

  • Ctrl+A or Home – moves the cursor to the start of a line.
  • Ctrl+E or End – moves the cursor to the end of the line.
  • Ctrl+B or Left Arrow – moves the cursor back one character at a time.
  • Ctrl+F or Right Arrow – moves the cursor forward one character at a time.
  • Ctrl + Left Arrow or Alt+B or Esc and then B – moves the cursor back one word at a time.
  • Ctrl + Right Arrow or Alt+C or Esc and then F – moves the cursor forward one word at a time.

बैश इतिहास के माध्यम से खोजें

निम्नलिखित शॉर्टकट बैश इतिहास में कमांड खोजने के लिए उपयोग किए जाते हैं:

  • Up arrow key – retrieves the previous command. If you press it constantly, it takes you through multiple commands in history, so you can find the one you want. Use the Down arrow to move in the reverse direction through the history.
  • Ctrl+P and Ctrl+N – alternatives for the Up and Down arrow keys, respectively.
  • Ctrl+R – starts a reverse search, through the bash history, simply type characters that should be unique to the command you want to find in the history.
  • Ctrl+S – launches a forward search, through the bash history.
  • Ctrl+G – quits reverse or forward search, through the bash history.

कमांड लाइन पर टेक्स्ट हटाएं

कमांड लाइन पर टेक्स्ट को हटाने के लिए निम्न शॉर्टकट का उपयोग किया जाता है:

  • Ctrl+D or Delete – remove or deletes the character under the cursor.
  • Ctrl+K – removes all text from the cursor to the end of the line.
  • Ctrl+X and then Backspace – removes all the text from the cursor to the beginning of the line.

कमांड लाइन पर टेक्स्ट या चेंज केस ट्रांसफर करें

ये शॉर्टकट कमांड लाइन पर अक्षरों या शब्दों के मामले को स्थानांतरित या बदल देंगे:

  • Ctrl+T – transposes the character before the cursor with the character under the cursor.
  • Esc and then T – transposes the two words immediately before (or under) the cursor.
  • Esc and then U – transforms the text from the cursor to the end of the word to uppercase.
  • Esc and then L – transforms the text from the cursor to the end of the word to lowercase.
  • Esc and then C – changes the letter under the cursor (or the first letter of the next word) to uppercase, leaving the rest of the word unchanged.

लिनक्स में प्रक्रियाओं के साथ काम करना

निम्न शॉर्टकट आपको लिनक्स प्रक्रियाओं को नियंत्रित करने में मदद करते हैं।

  • Ctrl+Z – suspend the current foreground process. This sends the SIGTSTP signal to the process. You can get the process back to the foreground later using the fg process_name (or %bgprocess_number like %1, %2 and so on) command.
  • Ctrl+C – interrupt the current foreground process, by sending the SIGINT signal to it. The default behavior is to terminate a process gracefully, but the process can either honor or ignore it.
  • Ctrl+D – exit the bash shell (same as running the exit command).

के बारे में अधिक जानें: सभी लिनक्स में प्रक्रियाओं के बारे में पता करने के लिए आप की जरूरत है [व्यापक गाइड]

बैश बैंग (!) कमांड्स

इस लेख के अंतिम भाग में, हम कुछ उपयोगी ! (धमाके) संचालन की व्याख्या करेंगे:

  • !! – execute last command.
  • !top – execute the most recent command that starts with ‘top’ (e.g. !).
  • !top:p – displays the command that !top would run (also adds it as the latest command in the command history).
  • !$ – execute the last word of the previous command (same as Alt +., e.g. if last command is ‘cat tecmint.txt’, then !$ would try to run ‘tecmint.txt’).
  • !$:p – displays the word that !$ would execute.
  • !* – displays the last word of the previous command.
  • !*:p – displays the last word that !* would substitute.

अधिक जानकारी के लिए, बैश मैन पेज देखें:

$ man bash 

अभी के लिए इतना ही! इस लेख में, हमने कुछ सामान्य और उपयोगी बैश कमांड-लाइन शॉर्टकट और संचालन साझा किए। नीचे दिए गए टिप्पणी फ़ॉर्म का उपयोग किसी भी प्रश्न को बनाने या प्रश्न पूछने के लिए करें।