简体   繁体   中英

Cant open and edit .bash_profile on my Mac

I want to build an app with Eclipse and PhoneGap, and it is required to edit the .bash_profile file which is located under the Users folder. But I can't edit it (I can't open the file). Here are the instructions.

I can't open it when I navigate with the Finder to that file, and I can't open it when I use the command line

open ~/.bash_profile

I created the file with my mouse (right click, new file, and changed the name to .bash_profile ... it is now a shell script).

What am I doing wrong?

You are not doing anything wrong, files starting with a dot (.) are hidden, simply edit the file, and everything is okay.

So you can for example do nano ~/.bash_profile or vim ~/.bash_profile or whichever favorite editor you are using.

You can see your ~/.bash_profile if you start the Terminal application and type:

ls -a

into the Terminal window, since the "-a" option shows even hidden files.

Can use vi editors with the following comment to open the file to edit in terminal

vi .bash_profile

Can user (E) to edit the respective file在此处输入图片说明

For more useful comments like insert and save on vi editor refer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM