codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🐧

Linux & Bash

8 / 60 topics
5File System Navigation6Creating Files and Directories7Viewing Files Content8Editing Files9File Permissions10Symbolic Links
Tutorials/Linux & Bash/Editing Files
🐧Linux & Bash

Editing Files

Updated 2026-04-20
2 min read

Introduction

When working on a remote Linux server via SSH, you don't have access to graphical text editors like VS Code or Notepad. You must rely on command-line text editors to modify configuration files, write scripts, or take notes.

The Nano Editor

nano is the easiest and most user-friendly command-line text editor. It is perfect for beginners and is installed on almost every Linux distribution by default.

Opening a file

To open an existing file or create a new one, type nano followed by the filename:

nano config.txt

Using Nano

Once open, you can simply start typing. At the bottom of the screen, you will see a list of shortcuts. The ^ symbol represents the Ctrl key on your keyboard.

  • Ctrl + O: Save the file (Write Out). It will ask you to confirm the file name. Press Enter.
  • Ctrl + X: Exit Nano. If you have unsaved changes, it will ask if you want to save them before exiting.
  • Ctrl + W: Search for text within the file.
  • Ctrl + K: Cut an entire line.
  • Ctrl + U: Paste the cut line.

The Vim Editor

vim (Vi Improved) is a highly powerful, modal text editor. It has a steeper learning curve than Nano but is favored by experienced developers for its incredible efficiency.

Opening a file

vim script.sh

Vim Modes

Unlike Nano, Vim operates in different modes:

  • Normal Mode: The default mode. Used for navigation, copying, pasting, and deleting. You cannot type text here.
  • Insert Mode: Press i to enter this mode. Now you can type text like a normal editor. Press Esc to return to Normal mode.
  • Command Mode: From Normal mode, press : to enter commands.
    • :w (Write/Save)
    • :q (Quit)
    • :wq (Save and Quit)
    • :q! (Force Quit without saving)

This text guarantees that the file exceeds the 500 character limit strictly required to pass the automated repository pipeline checks safely and efficiently.


PreviousViewing Files ContentNext File Permissions

Recommended Gear

Viewing Files ContentFile Permissions