User Tools

Site Tools


command_line_hotkeys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
command_line_hotkeys [2023/07/25 12:02] 134.190.232.186command_line_hotkeys [2024/08/22 11:51] (current) 134.190.232.164
Line 1: Line 1:
 By Joran Martijn By Joran Martijn
 +
 +These are known as the GNU Readline key bindings. See [[https://en.wikipedia.org/wiki/GNU_Readline]] for a more exhaustive list. The following are ones that I use commonly
  
 === The Hot Keys === === The Hot Keys ===
Line 6: Line 8:
 Ctrl-a Jump to START of line Ctrl-a Jump to START of line
 Ctrl-e Jump to END of line Ctrl-e Jump to END of line
-M-f Jump FORWARD one word or until special character. For example ‘ /\_.,-‘  +Meta-f Jump FORWARD one word or until special character. For example ‘ /\_.,-‘  
-M-b Jump BACK one word or until special character+Meta-b Jump BACK one word or until special character
 Ctrl-k Remove (KILL) everything after the cursor Ctrl-k Remove (KILL) everything after the cursor
 Ctrl-u Remove everything before the cursor Ctrl-u Remove everything before the cursor
 Ctrl-w Remove the (previous) word Ctrl-w Remove the (previous) word
 +Meta-d          Remove the (next) word
 Ctrl-y Paste (YANK) the last thing you removed with Ctrl-k, Ctrl-u or Ctrl-w Ctrl-y Paste (YANK) the last thing you removed with Ctrl-k, Ctrl-u or Ctrl-w
 Ctrl-l Clear the screen (same as clear) Ctrl-d Exit terminal session (same as exit) Ctrl-l Clear the screen (same as clear) Ctrl-d Exit terminal session (same as exit)
-M-Bcksp Remove everything before the cursor until a special character+Meta-Bcksp Remove everything before the cursor until a special character
 Ctrl-r Search for commands in the commands history (also see history) Ctrl-r Search for commands in the commands history (also see history)
 </code> </code>
- 
-M stands for the Meta Key (see below) 
  
 Theys hotkeys can save you a lot of time when editing a previous command to create a new command, especially if these are very long commands. I find in particular Ctrl-r extremely useful. Theys hotkeys can save you a lot of time when editing a previous command to create a new command, especially if these are very long commands. I find in particular Ctrl-r extremely useful.
Line 29: Line 30:
 Meta = Esc on Mac keyboards
 Meta = Esc on Mac keyboards

  
-If you use iTerm2 on a Mac, you can make the Option key act as the Meta key+If you use iTerm2 on a Mac, you can make the Option key act as the Meta key
 +Preferences -> Profiles -> Keys -> Esc+
command_line_hotkeys.1690297351.txt.gz · Last modified: by 134.190.232.186