New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

.bash_profile messed up


Post Reply New Thread Subscribe

 
Thread Tools
mikewatt

 
Member Since: Dec 11, 2010
Posts: 3
mikewatt is on a distinguished road

mikewatt is offline
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
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,348
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,457
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
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.
QUOTE Thanks
mikewatt

 
Member Since: Dec 11, 2010
Posts: 3
mikewatt is on a distinguished road

mikewatt is offline
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...
Attached Images
File Type: png Picture 3.png (20.3 KB, 14 views)
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,348
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,457
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
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.
QUOTE Thanks
mikewatt

 
Member Since: Dec 11, 2010
Posts: 3
mikewatt is on a distinguished road

mikewatt is offline
Thanks, the Tinker program worked great. Thanks again.

Mike
QUOTE Thanks
ek1414

 
Member Since: Jan 27, 2011
Posts: 1
ek1414 is on a distinguished road

ek1414 is offline
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?
QUOTE Thanks
Bwoe

 
Member Since: Feb 18, 2011
Posts: 4
Bwoe is on a distinguished road

Bwoe is offline
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 Code:
defaults write com.apple.finder AppleShowAllFiles TRUE 
then restart finder with:
PHP Code:
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 Code:
defaults write com.apple.finder AppleShowAllFiles FALSE 
and kill finder again.

Alternately, from the second mac you could just:
PHP Code:
sudo rm -rf [dragpathtofile
QUOTE Thanks
karl07

 
Member Since: Oct 30, 2012
Posts: 1
karl07 is on a distinguished road

karl07 is offline
... 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
QUOTE Thanks

Post Reply New Thread Subscribe


« email extractor | xcode C++ library help »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Parts of screen getting messed up. rohan.xlr8 OS X - Operating System 17 05-15-2010 01:15 PM
LCD screen messed up. bad. birdhouse360360 iPhone Hardware and Accessories 13 04-24-2009 06:50 AM
My permissions are very seriously messed up GraeYohe OS X - Operating System 9 10-10-2008 06:00 PM
Cursor is HUGE. spacing in everything is messed up. NateL OS X - Operating System 6 11-13-2007 08:18 PM
dashboard messed up jklfafa OS X - Operating System 2 12-17-2005 11:24 AM

All times are GMT -4. The time now is 04:08 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?