
Secondly, if you are working with the terminal it can just be more efficient to use the terminal to edit or save a file. In which case you may opt to run only the Linux command line. With the uprising of embedded electronics and the popularity of Raspberry Pi, you may very well be using something like the Pi without a GUI.Ī GUI can be an unnecessary overhead for a small computer like the Pi, especially the Pi Zero. Well firstly that last statement isn’t entirely true.

In today’s day and age it is very unlikely that you will be working without a GUI and access to a text editor program, so why use the terminal?

To create the file without opening the editor, use touch.

Of course, you can also use vi or vim, but if you choose to you definitely need to read about how first (if you're coming from a graphical background you've almost certainly never even heard of a modal editor before). Your syntax will be nano /path/to/file.txt. Using nano will let you perform all three actions (create the file, edit the text, and view it) all with one command. A somewhat controversial choice among frequent terminal users, but unlike viand vim, nano isn't modal (ie, it's going to work the way you would expect a graphical text editor to work). For personal use (ie, not in scripts) I recommend nano.
