In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to set the Linux command as keyboard shortcuts, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
You can assign any command or combination of commands to a key on the keyboard, which can be Alt+ [Amurz]
Ctrl- [Amurz], Alt+Shift+ [AMULZ], F1-F12, Ctrl-F [1-12], Alt-F [1-12], Alt+Shift+F [1-12] and, more incredibly, you can even add "parameters" to the function key so that when you press that key, it waits for you to enter the appropriate parameters and run different commands according to different parameters.
Of course, some hotkeys will be captured by the terminal, such as the common Ctrl-D/C/Q/Z, but it doesn't matter, there are still many hotkeys available!
The configuration file that defines the hotkey is / etc/inputrc or ~ / .inputrc. The format of the hotkey is as follows:
"" hotkey corresponding ASCII character "": "" Command executed ""
The ASCII character corresponding to the hotkey can be entered by "press Ctrl-V first, then press the hotkey". For example, the character corresponding to Ctrl-G is ^ G, the character corresponding to Alt-P is ^ [p, and the character corresponding to Ctrl-Alt-H is ^ [^ H.
/ C can be used instead of Ctrl,/M instead of Alt, and / M muster C instead of Alt-Ctrl, such as / C M = Ctrl-M, / M-/C-H = Alt-Ctrl-M. You can also use / e to represent ^ [.
Let's start with some basic hotkey definitions (the letters in the hotkey here are not case-sensitive):
"^ [-": "su-/ Cmurm" # Press Alt+- to execute the su-command, ending / Cmurm means enter after entering the defined command, or it can be expressed more succinctly by a / n.
/ M-/C-G ":" gaim & & "/ dev/null & & disown/C-M"
# Press Ctrl-Alt-g to open gaim in the current shell and run independently from the shell, that is, even if you exit the shell, gaim will not close
Some other key combinations can be configured according to their own needs, so I won't say much about it.
You may think that defining hotkeys in this way is too messy, and it's hard to remember that there are certain restrictions. This problem will be solved later.
In general, we can use the up and down arrow keys to find the command history list, so as to repeatedly enter the command, but the arrow key is too far from the main key area, such as "if it is used frequently, it will waste a lot of time." and it is not very convenient to move the right hand, is there any way to transfer the function of the arrow keys to the place where we often "hit the command"? If you use Alt+J = Down Arrow to look down, Alt+K=Up Arrow to look down
You can do this by defining hotkeys:
"/ eh": "^ [OD" # move left
# Alt-H moves one character to the left, which is equivalent to Left Arrowgh, where ^ [OD is the ASCII character of the up arrow, entered in a manner similar to that mentioned earlier
"/ el": "^ [OC" # move right
# Alt-L moves one character to the right, which is equivalent to Right Arrow
"/ ej": "^ [OB" # move up
# Alt-J moves downwards, which is equivalent to Up Arrow
"/ ek": "^ [OA" # move down
# Alt-K moves up, which is equivalent to Down Arrow
"/ ei": "^?" # left earse one character
# Alt-I deletes one character to the left, which is equivalent to Backspace
"/ eo": delete-char # right earse one character
# Alt-O removes one character to the right, which is equivalent to Delete
"/ en": backward-kill-word # left kill one word
# Alt-N deletes a word to the left
"/ em": kill-word # right kill one word
# Alt-M deletes a word to the right
"/ ea": "^ [n ^ [n ^ [n ^] n ^ [n ^ [n" # kill to the head
# Alt-A deletes the current location to the beginning, that is, several times more Alt-N ("ahead")
"/ ee": "^ [m ^ [m ^ [m ^] m ^ [m ^ [m ^" # kill to the head
# Alt-E deletes the current location to the end, that is, several times more Alt-M ("end")
"/ ep": insert-last-argumem "
# Alt-P insert the last argument of the previous command (Pmure-"Paste)
"/ ew": forward-word
# the system defaults to Alt-F (forward) to skip to the end of the current word, or to the end of the next word (the right word) if it is already at the end of the word
"/ eq": backward-word
# the system defaults to Alt-B (backward) to jump to the beginning of the current word, or to the beginning of the previous word (the word on the left) if it is already at the beginning of the word
The above is all the contents of the article "how to set the Linux command as a keyboard shortcut". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.