LINUX improve the work efficiency - set up under the command prompt hotkey

  Linux is a feature of its orders and more powerful and frequent input command not only cumbersome and larger workload, although can be used for TAB> fill the order, or use a aliase order to simplify the input, but that does not fundamentally from percussion keyboard to resolve the issue of excessive. 

  Can be of any order or orders assigned to a combination of a button on the keyboard, it could be Alt + [AZ] 
  Ctrl-[AZ], Alt + Shift + [AZ], F1-F12, Ctrl-F [1-12], Alt-F [1-12], Alt + Shift + F [1-12], there are not more even disbelieve the function keys can also add "parameters", so you press that button, it will wait for you to enter the corresponding parameters, and in accordance with different parameters running on different orders. 

  Of course, there are some hotkey will be captured by the terminal, such as the common Ctrl-D/C/Q/Z, okay, however, also available hotkey Chezhaona! 

  Hotkey definition of the configuration file: / etc / inputrc or ~ /. Inputrc defined hotkey format are as follows: 

  "<Hotkey corresponding ASCII characters >":"< implementation of the orders>" 

  Which hotkey corresponding ASCII characters can use the "press Ctrl-V, and then click hot keys" approach to the importation, such as Ctrl-G ^ corresponding to the characters G, Alt-P for the corresponding characters ^ [p, Ctrl - Alt-H counterparts of the characters ^ [^ H. 

  Can \ C instead of Ctrl, \ M to replace Alt, \ M-\ C instead of Ctrl-Alt, such as \ CM = Ctrl-M, \ M-\ CH = Alt-Ctrl-M. You can also use \ e ^ representative [. 

  First look at some of the basic hotkey definition (here in the hotkey not distinguish between upper and lower case letters): 
  "^[-":" Su - \ CM "# Alt + - Executive su - orders at the end of \ CM said that the definition of input End Enter order, it could be more concise with a \ n to express. 

  "\ M-\ CG": "gaim &> / dev / null & disown \ CM" 
  # Press Ctrl-Alt-g gaim open in the current shell, and out of the shell operate independently, that is: even if you withdraw from the shell, gaim also will not be closed 

  Other key combinations can be configured according to their own needs, not Oujiu said. 

  Members may feel that this is too arbitrary definition hotkey, and it is difficult to remember that there are certain restrictions.    This issue will be resolved in the back. 

  Under normal circumstances, we can use the direction keys to find the upper and lower order history list, to re-enter orders, but key areas far away from the keyboard, such as> fruit frequently used words, a lot of time will be wasted, and not moving his right hand when very convenient, there is no way to transfer the function of the direction keys to our regular> knock order places?    Such as the use Alt + J = Down Arrow downward View, K = Alt + Up Arrow downward View 

  Defined hotkey can be done through: 

  "\ Eh ":"^[ OD" # move left 
  # Alt-H to backspace character, or Left Arrowgh here ^ [OD that the upward direction of bond ASCII characters, and the importation of the above-mentioned manner similar 
  "\ El ":"^[ OC" # move right 
  # Alt-L shifted to right to a character, or Right Arrow 

  "\ Ej ":"^[ OB" # move up 
  Alt-J # moving down, or Up Arrow 

  "\ Ek ":"^[ OA" # move down 
  # Alt-K upward mobile, or Down Arrow 

  "\ # Ei ":"^?" left earse one character 
  # Alt-I left delete a character, or Backspace 

  "\ Eo": delete-char # right earse one character 
  # Alt-O right to delete a character, or Delete 

  "\ En": backward-kill-word # left kill one word 
  # Alt-N left delete a word 

  "\ Em": # kill-word right kill one word 
  # Alt-M to delete a word right 

  "\ Ea ":"^[ n ^ [n ^ [n ^ [n ^ [n ^ [n ^ [n" # kill to the head 
  # Alt-A to delete the beginning of the current location, which is several times more than Alt-N (A -> ahead) 

  "\ Ee ":"^[ m ^ [m ^ [m ^ [m ^ [m ^ [m ^ [m" # kill to the head 
  # Alt-E to delete the current location at the end, which is several times more than Alt-M (E -> end) 

  "\ Ep": insert-last-argumem " 
  Alt-P # insert a command on the final parameters (P -> Paste) 

  "\ Ew": forward-word 
  # Default Alt-F (forward) Skip to ending the current word, if in the suffix, the word to the next one (the right word) suffix 

  "\ Eq": backward-word 
  # Default Alt-B (backward) Skip to the present word first word, if in the first term, Skip to the last word (a word the left) the first word 

  F and B bond that was too far away from, inconvenience, were converted to dual Alt-Q, Alt-W, but Alt-F / B can be used as usual 

  This input can be ordered at almost do not have to leave the keyboard, and move the cursor to delete characters, delete the word, from top to bottom command history View are concentrated> in one, and more convenient than ever before.    But there may be some unaccustomed began, as told to use vi, but several more on the training of skilled. 

  The vast majority of services under Linux configuration is based on the configuration files, in general, a change in the configuration file, it should take effect immediately, also resuming the service directly or dependent daemon才行.    Do you not feel that "each vi / etc / xxx.conf after another service xxx restart / reload or killall-HUP xxx" very cumbersome to do so?    If you want to configure more services and to continuously debug?    Moreover, we usually use Linux, it is inevitable from time to time to terminate or activate a service process, the number of import orders are also quite a number.    If services are designated for each of a hotkey so, it seems unlikely.    If we are given a hotkey for a basic button, and the corresponding services for the "parameters", how? 

  For example, given Alt-S (S -> Start) for the launch of key basic services, services of the former two characters for the launch of "parameters", it can be as arbitrary as Below launched a service: 
  "\ Essm": "service smb start \ n" 
  # \ Es = Alt-s, sm = smb, 
  #: Press Alt-s immediately after the re-importation sm (sm then imported and not be shown in the terminal), we can start the process of samba services, press the button and have to worry about the importation of "parameters" of the time delay , you press Alt-s, and then come back to the outside Douyijuan, followed importation sm, still can. 

  "\ Esht": "service httpd start \ n" # ht = httpd, Apache service launched 

  Similarly, we have entrusted 
  Alt-D (D -> shutDown) to halt the primary key 
  Alt-R (R -> Restart) for the resumption of the primary key 
  Alt-T (T -> Status) for a list of the basic state bond 
  Alt-C (C -> Configure) to open the corresponding services of the primary key configuration files such as: "\ ecnf": "vi / etc / exports \ n" # Alt-c + nf open NFS configuration files 
  "\ Ecsm": "vi / etc / samba / smb.conf \ n" # Alt-c + sm open the configuration file smb 

  If a certain services (such as ssh) two configuration files can then coupled with a number, such as: 
  "\ Ecssh1": "vi / etc / ssh / sshd_config \ n" # open sshd server configuration file 
  "\ Ecssh2": "vi / etc / ssh / ssh_config \ n" # open sshd client configuration file 

  If an application to be implemented?    Alt-x can be used to do basic button (x -> eXeccute): 
  "\ Exga": "gaim &> / dev / null & & & & clean disown \ n" 
  "\ Exxm": "xmms &> / dev / null & & & & clean disown \ n" 
  "\ Exvm": "vmware &> / dev / null & & & & clean disown \ n" "\ exna": "nautilus &> / dev / null & & & & clean disown \ n" 
  And so on …. 

  Up to now we only according to a key combination +2 characters can be achieved below many functions: 
  1. Implementation of the designated application 
  2. Start | restart | Close | designated service process 
  3. Show designated state services 
  4. Designated open the configuration file specified services 

  Compiled a rough, it is quite messy, please do not mind if the text omitted any fault or wrong, please correct me! 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Tags:

Releated Articles


0 Comments to “LINUX improve the work efficiency - set up under the command prompt hotkey”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.