Editing files

Linux Command Line Quick Reference

1 min read

Published Aug 18 2026


19
0
0
0

CLILinuxUbuntu

Terminal editors modify text files directly on the server. Ubuntu commonly provides nano; vim may also be installed.

Open a text file

bash
nano file.txtnano +25 file.txtvim file.txtview file.txt

In Nano, Ctrl+O writes the file, Ctrl+X exits, Ctrl+W searches and Ctrl+K cuts the current line.

In Vim, press i to enter insert mode and Esc to return to command mode. :w writes, :q quits, :wq writes and quits, and :q! abandons unsaved changes.

For quick non-interactive changes, tools such as sed are often better than opening an editor. See the replacing file content section.

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact
Linux Command Line Quick Reference | Editing files | SimpleSteps.guide