You can use various text editors to edit the .bashrc file. Here are instructions for a few popular ones:
Using vim
-
Open a terminal.
-
Type the following command:
vim ~/.bashrc -
Press
ito enter insert mode and make your changes. -
Press
Escto exit insert mode. -
Type
:wqand pressEnterto save and exit.
Using gedit (Graphical Editor)
-
Open a terminal.
-
Type the following command:
gedit ~/.bashrc -
Make your changes in the graphical editor.
-
Save the file and close the editor.
Using nano
-
Open a terminal.
-
Type the following command:
nano ~/.bashrc -
Make your changes.
-
Save the file by pressing
CTRL + O, then pressEnter. -
Exit by pressing
CTRL + X.
Using emacs
-
Open a terminal.
-
Type the following command:
emacs ~/.bashrc -
Make your changes.
-
Save the file by pressing
CTRL + X, thenCTRL + S. -
Exit by pressing
CTRL + X, thenCTRL + C.
Choose the editor that you are most comfortable with!
