LPIC-1 notes

Chapter 1

Basic editing operations

  • Move within the line

    • Ctrl + A: move the cursor to the start of the line
    • Ctrl + E: move the cursor to the end of the line.
    • Ctrl + B: moving backward within a line.
    • Ctrl + F: moving forward within a line.
    • Ctrl + Left arrow key: moves backward a word at a time, as does pressing Esc and then B or F.
    • Ctrl + Right arrow key: moves forward a word at a time.
  • Delete text

    • Ctrl + D/Delete: deletes the character under the cursor, whereas pressing the Backspace key deletes the character to the left of the cursor.
    • Ctrl + K: deletes all text from the cursor to the end of the line.
    • Ctrl + X + Backspace: deletes all the text from the cursor to the beginning of the line.
  • Transpose text

    • Ctrl + T: transposes the character before the cursor with the character under the cursor.
    • Esc and then T transposes the two words immediately before (or under) the cursor.
  • Invoke an editor to edit command

    1. Ctrl + X followed by Ctrl + E. The bash shell attempts to launch the editor defined by the $FCEDIT or $EDITOR environment variable or Emacs as a last resort.
    2. Start editing your command, when you are done, save and exit to the terminal.
    3. The edited command is run automatically.