I open bash_profile using the command
nano .bash_profile
To save, I tried ctlr + x, then Y.
then I open the file again, changes are not there?
what am I doing wrong here?
As long as you had write permissions on the file you were editing, your new changes will be applied to the file. In this guide, we saw how to exit and save a file using the nano editor on Linux. The key to remember is that you need to press Ctrl + X to close the editor.
If you want to save the changes you've made, press Control + O. To exit nano, type Control + X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press N in case you don't, or Y in case you do.
How to Use Nano 1 On the command prompt, type nano followed by the filename. 2 Edit the file as required. 3 Use the Ctrl-x command to save and exit the text editor. See More....
A Simple Guide to Create, Open, and Edit bash_profile. Create the .bash_profile File. Open the command by a shortcut key Ctrl+Alt+T or from the side icon of the terminal. The command is now opened. First ... List the .bash_profile File. Open the .bash_profile File. Edit the .bash_profile File. ...
In Nano Control + X exits the program. If you want to save changes to a file you've edited do:
Control + O then Enter followed by Control + X
This will overwrite the previous file with the changes and then exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With