Editing a File with VI Editor

The following steps illustrate how to edit a configuration file with the vi editor, which is the default text file editing tool of a Linux operating system.

1.Create a terminal and run the cd command at the command line to navigate to the directory where the configuration file is located.

2.Run the vi <configuration file name> command under the directory to show the configuration file.

3.Press the Insert or I key on your keyboard, and then move the cursor to the location where you want to edit.

4.Modify the file based on your needs, and then press the Esc key to exit the input mode.

5.Enter the :wq! command and press the Enter key to save the changes and exit the vi editor.