LWM-Linux/02 - Basic System Operations/Terminal text editor.md

1.5 KiB

  1. Opening and Creating Files:

    • To open an existing file or create a new one, type:
      nano filename
      
    • Replace filename with the actual name of the file you want to edit. Nano will open the file in a new editor window.
  2. Basic Editing:

    • Nano is modeless, meaning you can start typing and editing immediately.
    • To move the cursor to a specific line and character number, use Ctrl+_. Enter the line and column numbers when prompted.
    • To save your changes and exit, press Ctrl+x.
  3. Searching and Replacing:

    • To search for text, press Ctrl+w, type your search term, and press Enter.
    • To move to the next match, press Alt+w.
    • For search and replace, press Ctrl+\. Enter the search term and the replacement text.