![Ubuntu 20.04 Essentials](https://wfqqreader-1252317822.image.myqcloud.com/cover/879/36697879/b_36697879.jpg)
1.3 Editing Files
Configuring a Linux system typically involves editing files. For those new to Linux it can be unclear which editor to use. If you are running a terminal session and do not already have a preferred editor we recommend using the nano editor. To launch nano in a terminal window simply enter the following command:
# nano <file>
Where <file> is replaced by the path to the file you wish to edit. For example:
# nano /etc/passwd
Once loaded, nano will appear as illustrated in Figure 1-2:
![](https://epubservercos.yuewen.com/8B0F3C/19470370208766906/epubprivate/OEBPS/Images/Chapter_34.jpg?sign=1739404116-BtQvh3Zo2H7V2aKAYBCRt4tnuyUKqq0z-0-032137b2cc2cfd5c3cfe63b368658ec0)
Figure 1-2
To create a new file simply run nano as follows:
# nano
When you have finished editing the file, type Ctrl-S to save the file followed by Ctrl-X to exit. To open an existing file, use the Ctrl-R keyboard shortcut.
If you prefer to use a graphical editor within the GNOME desktop environment gedit is a useful starting point for basic editing tasks. To launch gedit from the desktop press Alt-F2 to display the Enter a Command window as shown in Figure 1-3:
![](https://epubservercos.yuewen.com/8B0F3C/19470370208766906/epubprivate/OEBPS/Images/Chapter_26.jpg?sign=1739404116-fBi8q0b1j61apSwmRiRGVJiLsluXWtTk-0-07ef649524d5507162e9a32a1f87fcd3)
Figure 1-3
Enter gedit into the text field and press the Enter key. After a short delay, gedit will load ready to open, create and edit files:
![](https://epubservercos.yuewen.com/8B0F3C/19470370208766906/epubprivate/OEBPS/Images/Chapter_28.jpg?sign=1739404116-2aR7JnS9nHoxxKaLodefO9CQxhN0pzws-0-b76a17da4e3dcc57994091b3007c1065)
Figure 1-4
Alternatively, launch gedit from a terminal window either with or without the path to the file to open:
# gedit
# gedit /etc/passwd