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.

terminal is messed up


Post Reply New Thread Subscribe

 
Thread Tools
germpest
Guest
 
Posts: n/a

I am trying to learn the terminal and for some reason basic commands don't work. I am trying "ls" and it says bash: ls :command not found. Although yesterday this was working fine. Is there a way to reinstall the terminal?
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,011
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 future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
It's not the terminal, it's your path, or lack thereof. What do you get when you type:
echo $PATH

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
germpest
Guest
 
Posts: n/a

Quote:
Originally Posted by cradom
It's not the terminal, it's your path, or lack thereof. What do you get when you type:
echo $PATH
/opt/local/bin:/opt/local/sbin:{ PATH} :/usr/local/bin
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,011
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 future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Hmmm...looks like something is messed up. Check your .bashrc or .bash_profile file for syntax errors. Probably where it says { PATH}. Should look like this: ${PATH}.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
germpest
Guest
 
Posts: n/a

Quote:
Originally Posted by cradom
Hmmm...looks like something is messed up. Check your .bashrc or .bash_profile file for syntax errors. Probably where it says { PATH}. Should look like this: ${PATH}.
where is that located? /etc/? I can't even su to root.
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
In your home directory/folder.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,011
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 future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
What rman said. You can open a terminal and type:
/bin/ls -a
to see if it's there. If you're not familiar with the pico editor or vi, you can open it and edit it with Textwrangler (free) from the Finder. Use the 'open hidden' menu item.

From what your $PATH shows, you might have DarwinPorts installed? Normally there is no /opt directory in OS X, and nothing in /usr/local/bin.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
germpest
Guest
 
Posts: n/a

Quote:
Originally Posted by cradom
What rman said. You can open a terminal and type:
/bin/ls -a
to see if it's there. If you're not familiar with the pico editor or vi, you can open it and edit it with Textwrangler (free) from the Finder. Use the 'open hidden' menu item.

From what your $PATH shows, you might have DarwinPorts installed? Normally there is no /opt directory in OS X, and nothing in /usr/local/bin.
It's funny, all this trouble started when I was trying to install blackbox window manager. Something told me to install DarwinPorts and I didn't do that right. Then something else told me to change my bash_profile file and add a line to it. I screwed up the line...

Anyways, bash_profile isn't under my home directory.

"Edit either /etc/profile or ~/.bash_profile and add the following line at the end. You will need to re-login for the changes to take effect."

this is what I tried to follow.
QUOTE Thanks
germpest
Guest
 
Posts: n/a

I finally figured it out
it was etc/profile, and I had $P{PATH} instead of ${PATH}

thanks for all your help. this was a bit frustrating.
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,011
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 future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Actually, it's not a good idea to edit etc/profile because whatever is changed there will be global. It will affect all users on the machine, not just your account. If you screw up and create a new user to find the problem, you will have the same problem in the new user.

It's better to copy the file to your home folder or create a new one in your home folder so it just affects your account.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
Like cradom suggested it is better to make change to you personal copy and not the system copy.

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
Logan
Guest
 
Posts: n/a

Sort of off topic but I wanted to mention anyways, iTerm is a handy free download for those of you who want a little bit more out of your Terminal.

and for no particular reason: I love pico. vi makes me cry.
QUOTE Thanks

Post Reply New Thread Subscribe


« Creating Universal Binaries with XCode Tools | How to create a link to a device like /dev/tty.xyz »
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
The mysterious Terminal Kokopelli OS X - Operating System 2 03-05-2006 08:23 AM
Problem with terminal, always runs Fink task at startup thomanil OS X - Operating System 3 07-03-2005 05:00 PM
VIM on the terminal zero17 OS X - Development and Darwin 10 06-01-2005 11:04 PM
Terminal Help rs2sensen OS X - Apps and Games 1 04-25-2005 10:52 PM
My Terminal is messed up. edokid Switcher Hangout 8 11-16-2004 02:42 AM

All times are GMT -4. The time now is 07:50 AM.

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?