

Then type followed by the filename that you want to edit. Navigate to the directory where the file is placed. To edit any config file, simply open the Terminal window by pressing the Ctrl+Alt+T key combinations. For instance to save a file, press Ctrl+O. They are displayed at the bottom and can be triggered with the Ctrl key. You do not have to learn the Nano editor before using it and also there is no need to remember the commands. Nano is the simplest and the powerful built-in editor in the many Linux distributions.

Once you have done with the editing, press Ctrl+S to save the file. As soon as the editor window opens, you can start typing or editing without entering in any mode. It is like the notepad editor in Windows OS. When prompted for a password, enter sudo password.Įxample: editing of the /etc/nf file Replace /path/to/filename with the actual file path of the configuration file that you want to edit. Then type the below command as sudo: $ sudo gedit /path/to/filename To edit a config file in text editor, launch Terminal by pressing Ctrl+Alt+T key combinations. It is the simpler and easier text editor as compared to other available text editors. It supports tabs so you can open different files in multiple tabs. Gedit is the default text editor of the Gnome desktop environment. By using these editors, you can easily edit files in terminal. Now let’s take a look at these text editors. The steps described in this guide have been tested on Ubuntu 20.04, but they will work on other Ubuntu versions too. In this article, I will describe multiple ways to edit config files in Ubuntu. To make any configuration changes, you have to open and edit the file using a text editor. Some of the examples of config files are nf, hosts. Configuration files on Ubuntu are stored in subdirectories of the /etc folder as a text file and can be edited using text editors. Linux users, especially Linux administrators, must know how to edit configuration files to maintain an Ubuntu server or desktop. Configuration files contain the information required to control the operation of a program.
