User:Maffblaster/Reference

From Gentoo Wiki
Jump to:navigation Jump to:search

A place where I store different command-line shortcuts and other things I reference often.

Shortcuts

bash

The following sections are select excerpts from the bash man page. They can be retrieved locally by reading man bash. They useful contain command-line shortcuts and bash built-ins.

Search for Commands for Moving for the beginning of the section.

Navigation

Line
  • ctrl+e - Move cursor to the end of the line.
  • ctrl+a - Move cursor to the beginning of the line.
  • ctrl+]-<CHAR> - Move cursor to the first occurrence of the CHAR to the right.
  • ctrl+alt-]-<CHAR> - Move cursor to the first occurrence of the CHAR to the left.
  • alt+f - Move cursor forward one word.
  • alt+b - Move cursor backward one word.
Directories
  • cd - - Change to previous directory.
  • cd - Change to home directory.

Reset

  • ctrl+l - Resets the

Text manipulation

Deletion
  • ctrl+u - Remove text relative to the cursor's current position to the beginning of the line.
  • ctrl+k - Remove text relative to the cursor's current position to the end of the line.
  • alt+d - Remove one word moving forward from the cursor's current position.
  • ctrl+w - Remove one word moving backward from the cursor's current position.
  • ctrl+y - Paste back deleted text.

History

  • ctrl+p - Scroll backward through previous command history for the current session.
  • ctrl+p - Scroll forward through next entry in command history for the current session
  • ctrl+r - Reverse search through history (type parts of the command you remember).