Editing files
Linux Command Line Quick Reference
1 min read
This section is 1 min read, full guide is 20 min read
Published Aug 18 2026
19
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
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.txtIn 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.