SAM-03

Cards (51)

  • Scripts are written in text editors
  • Many Linux programs use text-based data files for input
  • Many of Linux-operating system services use configuration files that are text-based
  • emacs can be customized and extended with different modes, enabling it to be used like IDE for programming languages such Java or C. It has be installed first
  • nano is a text editor editor designed for beginners
  • gedit comes with the Gnome desktop. It only runs in the GUI environment
  • vi is a native editor found in all Linux and Unix systems. Most Linux distributions do not include real vi; rather, they include an enhanced replacement called vim (short for vi improved)
  • 3 Modes of vi editor
    command
    insert
    replace
  • command: keystrokes entered operate as command rather than characters entered into the document
  • insert: any character entered is placed at the current cursor position
  • replace: any character entered replaces the character at the current cursor position
  • creating a new file:
    vi sample.txt
  • confirmation message:
    "sample.txt" [New File]
  • to add text, press 'i' key
  • to exit insert mode and return to command mode, press Esc
  • to save the changes you have change, press the :w command
  • l or right arrow : one character to the right
  • h or left arrow " one character to the left
  • j or down arrow : one line down
  • k or up arrow : one line up
  • 0 : to the beginning of the current line
  • ^ : to the first non-whitespace character on the current line
  • $ : to the end of the current line
  • w : to the beginning of the next word or punctuation character
  • W : to the beginning of the next word, ignoring punctuation characters
  • ctrl+f or page down : page down
  • ctrl+b : one page up
  • numberG : to line number ex: 1G
  • G : to the last line of the file
  • A : to append text to an existing file, moves the cursor to the end of the line before starting insert mode
  • o : insert the line below the current line
  • O : insert the line above the current line
  • x : delete current character
  • 3x : deletes current character and the next two characters
  • dd : deleted the current line
  • 5dd : deletes the current line and the next four lines
  • dW : deletes from the current cursor position to the beginning of the next word
  • d$ : deletes from the current cursor location to the end of the current line
  • d0 : deleteds from the current cursor location to the beginning of the line
  • d^ : deletes from the current cursor location to the first non-whitespace character in the line