how to delete a bash profile?

Hi All,


I accidentally created a bash profile while trying to find the JDK location on my system. I am not able to delete the bash profile created. I tried exiting the terminal and starting it fresh, but that did not help.

Can any one please guide me on how to go about deleting the bash profile?

MacBook Pro with Retina display, OS X Yosemite (10.10.1)

Posted on Nov 22, 2014 2:40 AM

Reply
4 replies

Nov 22, 2014 5:00 AM in response to sudeep yadav

The files that I know of that set a bash profile are:

<yourhomefolder>/.bashrc (you might not have this - or - this may be the one you added)

<yourhomefolder>/.profile (typically, this one is read and used every time you open the Terminal)

/etc/profile (this one is "global" - it is read and used before any user logs in - it applies to all users)


(<yourhomefolder> means the home folder with your username, which is in the /Users folder)

You should not mess with these files unless you know what you're doing.

Nov 22, 2014 5:18 AM in response to greg sahli

I wanted to edit that reply to look more like this:


The files that I know of that set a bash profile are:

<yourhomefolder>/.bashrc (you might not have this - or - this may be the one you added)

<yourhomefolder>/.profile (typically, this one is read and used every time you open the Terminal)

/etc/profile (this one is "global" - it is read and used before any user logs in - it applies to all users)

For increased security, /etc/profile refers to /etc/bashrc and /usr/libexec/path_helper


(<yourhomefolder> means the home folder with your username, which is in the /Users folder)

You should not mess with these files unless you know what you're doing.


These are simple text files.

What gets changed in them are system variables like default PATH to find executables.

Nov 22, 2014 3:19 PM in response to sudeep yadav

Back up all data.

Select

Shell ▹ New Command

from the Terminal menu bar. Uncheck the box marked

Run command inside a shell

if checked.

Copy and paste the following line into the text box that opens, then press return:

mkdir disabled_shell_files

Close the Terminal window that opens. Repeat with this line:

mv .profile .bash_history .bash_profile .bashrc .inputrc disabled_shell_files

Your old shell initialization and history files will be saved in a directory named "disabled_shell_files" at the top level of your home directory. It's normal that some of these files will not exist, and therefore you will get some "no such file" errors.

Close the window, open a new one, and test.

Nov 22, 2014 3:33 PM in response to sudeep yadav

Before we can tell you how to delete the file we need to know the following:

I accidentally created a bash profile while trying to find the JDK location on my system.


Where on your system did you create the file? Home directory, system directory, other?


I am not able to delete the bash profile created

What happens when you try to delete it? Error messages, etc.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to delete a bash profile?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.