# MacShell常用快捷键

## 我的常用：

Ctrl + a 光标移动到行首（Ahead of line）

Ctrl + e 光标移动到行尾（End of line）

Ctrl + l 清屏，相当于执行clear命令，也可以使用Command + k

Ctrl + d 删除一个字符，相当于通常的Delete键

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

pwd -P 显示真实的路径（解决cd进入软连接显示的是链接路径的问题）

## 其他：

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

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

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

Ctrl + p 调出命令历史中的前一条（Previous）命令，相当于通常的上箭头 Ctrl + n 调出命令历史中的下一条（Next）命令，相当于通常的上箭头 Ctrl + r 显示：号提示，根据用户输入查找相关历史命令（reverse-i-search） Ctrl + w 删除从光标位置前到当前所处单词（Word）的开头 Ctrl + y 粘贴最后一次被删除的单词

Command + T 新建标签

Command +W 关闭当前标签页

Command + S 保存终端输出

Command + D 垂直分隔当前标签页

Command + shift + {或} 向左/向右切换标签


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jun-wang.gitbook.io/learnjava/xiaolti-sheng/macshell-chang-yong-kuai-jie-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
