.bash_profile messed up

Joined
Dec 11, 2010
Messages
3
Reaction score
0
Points
1
Hi everyone,

I was wondering if anyone can tell me how to delete the .bash_profile I made..I made it and now when I'm in Terminal, none of the default commands are recognized anymore. Is there a way to go back to how it was before, with no .bash_profile?

Here's what I put in:

Code:
pico .bash_profile (this will create a .bash_profile)
- type the following in the new screen: export PATH=$
{PATH}:<sdkfolder>/tools
- Hit CNTRL + X
- Hit Y (for yes to save)
- It will return you to the terminal screen… type: exit

Any help greatly appreciated.

Mike
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Follow this to show all hidden files, delete what you need to, execute the command again replacing YES with NO and you should be good to go.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Or: rm .bash_profile
Assuming you're in your home folder.
If you typed that command as it's written you got caught by wordwrap.
it should be:
export PATH=${PATH}:<sdkfolder>/tools
where <sdkfolder> is the path to the folder where the SDK is.
 
OP
M
Joined
Dec 11, 2010
Messages
3
Reaction score
0
Points
1
I tried that but my Terminal doesn't accept any commands. Please look at the screenshot I've attached. Sorry, I'm a total newbie to Mac Terminal...

Picture 3.png
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I posted that last night when I was quite tired (it should still work though). In the meantime, you can execute the commands with the full path. rm is at /bin/rm if you use cradom's method and defaults is at /usr/bin/defaults.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Or you can get TinkerTool and show invisibles to delete it.
Forgot/didn't realize the rm command probably wouldn't work with the path messed up.
 
Joined
Jan 27, 2011
Messages
1
Reaction score
0
Points
1
same issue

I am having the same issue with incorrect commands and files not being found. which files did you delete in order to start over creating a new pico .bash_profile?
 
Joined
Feb 18, 2011
Messages
4
Reaction score
0
Points
1
If you have a second mac handy, and a firewire cable, you can boot to target disk mode and run the command to show hidden files from the second machine. You can then navigate to /.bash_profile (ON THE AFFECTED MACHINE) and trash it.
The syntax for showing hidden files is:
PHP:
defaults write com.apple.finder AppleShowAllFiles TRUE
then restart finder with:
PHP:
killall Finder


From here you can just go to /.bash_profile (again, on the affected machine) and trash or rename it.

Re-hide hidden files with
PHP:
defaults write com.apple.finder AppleShowAllFiles FALSE
and kill finder again.

Alternately, from the second mac you could just:
PHP:
sudo rm -rf [dragpathtofile]
 
Joined
Oct 30, 2012
Messages
1
Reaction score
0
Points
1
TinkerTool worked

... great for me. was desperate because no command was found any more. just deleted the messed up .bash_profile (something was wrong with PATH in there), and now i can use commands again!

thx!!!

karl07
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top