MAC terminal shortcut keys

Following are some of the mac terminal shortcut keys

Ctrl+a Move to the start of the line.
Ctrl+e Move to the end of the line.
Esc+f Move forward a word.
Esc+b Move backward a word.
Ctrl+l Clear the screen, reprinting the current line at the top.

Ctrl+k Kill the text from the current cursor position to the end of the line.
Esc+d Kill from the cursor to the end of the current word, or if between words, to the end of the next word.
Esc+Del Kill from the cursor the start of the previous word, or if between words, to the start of the previous word.
Ctrl+w Kill from the cursor to the previous whitespace. This is different than EscDel+Ctrl+a because the word boundaries differ.

Ctrl+d Delete the character underneath the cursor.
Ctrl+_ Undo the last thing that you did. You can undo all the way back to an empty line.

And, here is how to yank the text back into the line. Yanking means to copy the most-recently-killed text from the kill buffer.

Ctrl+y Yank the most recently killed text back into the buffer at the cursor.
Esc+y Rotate the kill-ring, and yank the new top. You can only do this if the prior command is Ctrl+y or Esc+y.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *