by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

I use iTem2 for the following operations on MacOS.
The hotkey may be different in different systems.

Mobile hotkey

# Quickly move the cursor – fast
CTRL+a Move to the front (same as Home key)
CTRL+e Move to the end (same as End key)
ESC+b Go back one word to the left (if not try Option+left)
ESC+f move one word to the right (if not try Option+right)
CTRL+b move one word backward
CTRL+f move forward one word

# character shifting – one word at a time
CTRL+f move forward one word
CTRL+b move one word backward

# use history history
CTRL+r history search, pressing Enterk will send command (history)
CTRL+p previous command (same as arrow key "up")
CTRL+n Next command (same as arrow key "Down")

Editing hotkey

# command line part copies deleted
CTRL+k Delete the text after the cursor (under the same terminal, you can use CTRL+y to paste back and delete)
CTRL+u Delete a whole column (under the same terminal, you can paste it back with CTRL=y, which reminds me that I forgot to add sudo after typing a command, CTRL+u and then CTRL+y)

# Single character deletion
CTRL+d If there are words behind the cursor, delete them one by one.
CTRL+h is equivalent to the backward key

# Paste, restore
CTRL+l clears the screen, which is similar to the Clear command
CTRL+y Paste back the deleted text, CTRL+k or CTRL+u
CTRL+_ The command that has not been sent, the operation is restored
CTRL+r replace the current line with history

# Swap position
CTRL+t Swaps the two words in front of the cursor or, if the English word is typed too fast, it should be useful when the front and back are wrongly typed.

# Convert to UPPER, lower, or Sentence case
ESC+u Change the word on and after the cursor to uppercase
ESC+l Change the word on and after the cursor to lowercase
ESC+c The word on the cursor is changed to uppercase, and then the cursor moves to the end

Tags: terminal shortcuts bash

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


ansible,bash

My first ansible, automated database transfer

In this article, I use Docker on MacOS to share my experience in using Ansible. You can adjust it to your desired Ansible environment according to this directory structure, or learn Ansible. The situation is like this, I hope that in my test environment, I can see articles that are the closest to the official machine, but I don't want to use the test machine program to directly connect to the database of the official machine. My manual method is to export the db of the official machine, copy it to the test machine and then import it. Although there are not a few steps, it seems to be a bit annoying to do, and manual operation is easy to make mistakes. This reminds me of Ansible. I've heard of it but haven't tried it, so why not give it a try.

bash,cli

some commands to check cpu, ram and disk info in linux

Introduce those commands that can be used to check hardware information on the Linux host

linux, mac, terminal, tips

How to clear the input of the current command line on the terminal of Linux or Mac?

How to clear the current command line in Linux or Mac terminal? For example, if you typed a bunch of instructions wrongly, and you want to clear them, Be sure to do the same as I used to, use the reverse key to kill slowly, we can use...