更新時間: 2024-09-27
目錄
- Cursor 的位置
- 刪除
- Other
- History
- Process
- Output control(flow)
Cursor 的位置
ctrl+a # Move the cursor at the beginning of the line(Home key)
ctrl+e # Move the cursor at the end of the line(End Key)
alt+f # 當前字尾 / 上一個字 (要左邊的 alt 鍵才有效)[same as alt + right arrow]
alt+b # 當前字首 / 下一個字 (要左邊的 alt 鍵才有效)[same as alt + left arrow]
上下左右
ctrl+p ctrl+f ctrl+b ctrl+n
刪除
ctrl-u # 刪除光標前的所有字符
ctrl+k # 刪除光標後的所有字符
ctrl+w # delete the word BEFORE the cursor
alt + d # delete the word FROM the cursor
ctrl+_ / ctrl+x,ctrl+u # Undo
Other
ctrl+l # 把 terminal 上過去的內容清空
ctrl+d # Exit shell (same as exit command)
ctrl+x ctrl+v # 查看 bash version
History
ctrl+r # 在 history 找回以前用過的指令(此 hotkey 可以按多次)
ctrl+g # 離開 ctrl + r
ctrl+o # 執行 ctrl+r 找出的 command
!! # Repeat last command
!* # All arguments of previous command
!$ (ALT + .) # Last argument of previous command
Process
ctrl-c kills the current command or process.
ctrl-d kills the shell.
ctrl-z 把當前執行中的指令停下來, 之後放到 backgroud job
Output control(flow)
ctrl+s
ctrl+q