2013年5月16日 星期四

unix 常用且實用的鍵盤快捷鍵

Ctrl + a - Jump to the start of the line
Ctrl + e - Jump to the end of the line

Ctrl + l - Clear the screen
Ctrl + r - Search the history backwards

Ctrl + b - Move back a char
Ctrl + f - Move forward a char

Ctrl + k - Delete to EOL (its actually a 'cut', you can paste using Ctrl + y)
Ctrl + u - Delete backward till begining of the line (its actually a 'cut', you can paste using Ctrl + y)

Alt + b - Move backward by a word
Alt + f - Move forward by a word

Alt + d - Delete word, keep deleting word forward
Ctrl + w - Delete from the cursor position, then one word at a time backward

Ctrl + p - 找出並顯示上一個指令
Ctrl + n - 找出並顯示下一個指令



 ~Moves to the user's home directory.
!!Repeats the line last entered at the shell. See history command for previous commands.()
!$Repeats the last argument for the command last used. See history command for previous commands.
resetResets the terminal if terminal screen is not displaying correctly.
shutdown -h nowRemotely or locally shuts the system down.


!!  執行上一次執行的指令
!$ 重複上次指令中的最後一個參數值