mac shell terminal command line editing shortcuts - beginning of the line, end of line

mac shell terminal command line editing shortcuts - beginning of the line, end of line

Ctrl + d        删除一个字符,相当于通常的Delete键(命令行若无所有字符,则相当于exit;处理多行标准输入时也表示eof)

Ctrl + h        退格删除一个字符,相当于通常的Backspace键

Ctrl + u        删除光标之前到行首的字符

Ctrl + k        删除光标之前到行尾的字符

Ctrl + c        取消当前行输入的命令,相当于Ctrl + Break

Ctrl + a        光标移动到行首(Ahead of line),相当于通常的Home键

Ctrl + e        光标移动到行尾(End of line)

Ctrl + f        光标向前(Forward)移动一个字符位置

Ctrl + b        光标往回(Backward)移动一个字符位置

Ctrl + l        清屏,相当于执行clear命令

Ctrl + p        调出命令历史中的前一条(Previous)命令,相当于通常的上箭头

Ctrl + n        调出命令历史中的下一条(Next)命令,相当于通常的上箭头

Ctrl + r        显示:号提示,根据用户输入查找相关历史命令(reverse-i-search)

Ctrl + w deleted from the head position before the cursor is currently located to a word (Word) of

Ctrl + y paste the last deleted word

Other Command-Line Tips

• Enter the command open. The current position can be opened with the Finder.

• You can set its look and style preferences inside the Terminal.

• abort a wrong command or crazy, you can use the key combination control + C.

• You can edit before executing the command, just use the arrows and other letters on the keyboard.

• When you do not enter any commands, you can use ▲ and ▼ to browse command history. The same can be edited and executed again.

• You can also use the history command to view history.

Command + K to clear the screen

Command + T new label

Command + W Close current tab

Save Command + S terminal output

Command + D vertically spaced current tab

Command + Shift + D horizontal divider current tab

Command + shift + {} or left / right switching tab

Published 11 original articles · won praise 18 · views 10000 +

Guess you like

Origin blog.csdn.net/hujinhong145/article/details/104094421