Skip to content

Instantly share code, notes, and snippets.

@pnhoang
Last active September 7, 2018 14:18
Show Gist options
  • Save pnhoang/585275c21b9189c0ebaaa8d0680d1076 to your computer and use it in GitHub Desktop.
Save pnhoang/585275c21b9189c0ebaaa8d0680d1076 to your computer and use it in GitHub Desktop.
Terminal Utilities

You can use Ctrl+U to clear up to the beginning.

You can use Ctrl+W to delete just a word.

You can also use Ctrl+C to cancel.

If you want to keep the history, you can use Alt+Shift+# to make it a comment.

Summarise all the answers

Clean up the line: You can use Ctrl+U to clear up to the beginning.

Clean up the line: Ctrl+A Ctrl+K to wipe the current line in the terminal

Cancel the current command/line: Ctrl+C.

Recall the deleted command: Ctrl+Y (then Alt+Y)

Go at the beginning of the line: Ctrl+A

Go at the end of the line: Ctrl+E

Remove the forward words for example, if you are middle of the command: Ctrl+K

Remove characters on the left, until the beginning of the word: Ctrl+W

To clear your entire command prompt: Ctrl + L

Toggle between the start of line and current cursor position: Ctrl + XX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment