|
|
#1 |
|
Prospect
Join Date: Jan 2002
Location: Oklahoma City
Posts: 6
|
terminal not behaving as expected
I'v only played w/the terminal a few times but I got a new Mac OS X book and was wanting to work through some of the terminal chapters. The problem is that I can't seem to get anything to work now. Before I could type "top" and it would run the top command but now it thinks I'm spelling it wrong and suggests "stop" instead. If I just hit enter then it says "top: Command not found."
Here's another example of the screwiness... [localhost:~] shawn% ls Apps Documents Movies Public Desktop Extra Stuff Music Sites Desktop (Mac OS 9) Library Pictures [localhost:~] shawn% cd /pictures /pictures: No such file or directory. [localhost:~] shawn% cd/Pictures cd/Pictures: Command not found. [localhost:~] shawn% cd /Pictures /Pictures: No such file or directory. [localhost:~] shawn% cd \Pictures [localhost:~/Pictures] shawn% This doesn't seem to jive with what the books say. Any suggestions or ideas? |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
|
About the 'top' command: type 'which top' in you terminal; you should get '/usr/bin/top' back as a response. If you don't, type 'env' and look for the 'PATH=' item in the list. Is '/usr/bin' in there somewhere? If it is, then you may need to reinstall the BSD subsystem from the CD.
As far as the 'cd' goes, if you are in your home directory '~' just type 'cd Pictures', not 'cd /Pictures' or 'cd \Pictures'. |
|
|
|
|
|
#3 |
|
Triple-A Player
Join Date: Jan 2002
Location: Goolwa, South Australia
Posts: 101
|
Some answers
1) top - command not found.
This is caused by the shell (which I presume is the default tcsh) having an incomplete PATH environment variable. Type echo $PATH in the terminal to see a list directories (Folders) that are in your PATH, your PATH being the places where the shell will look for things you try to run. Next type which top. If your PATH is correct, it'll tell you that top is to be found in /usr/bin/. I'd guess that at some point you've changed the value of your PATH. The result is that it no longer looks in /usr/bin/. 2) You cannot cd into the Pictures directory because you put / in front of it. cd /Pictures means change to the directory named Pictures inside the directory named / cd Pictures means change to the directory named Pictures that's in the current directory (i.e. where I am now). You can see what directory you're in with the command pwd. Pictures isn't in /, and you can see that it isn't with the command ls / |
|
|
|
|
|
#4 |
|
Prospect
Join Date: Jan 2002
Location: Oklahoma City
Posts: 6
|
Well, here is what happens:
[localhost:~] shawn% which top top: Command not found. [localhost:~] shawn% env OK? end? no env: Command not found. [localhost:~] shawn% echo $PATH /Users/shawn/bin/powerpc-apple-darwin:/Users/shawn/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin [localhost:~] shawn% I'm assuming that the path value has changed (you know how these computers always do things on their own) and that it needs to be changes back. Is this doable? BTW, thanks for the quick responses! |
|
|
|
|
|
#5 | |||||||||||||||||||
|
Triple-A Player
Join Date: Jan 2002
Location: Goolwa, South Australia
Posts: 101
|
Your PATH looks okay, it includes /usr/bin/ Now, I wonder if you have a /usr/bin, and if so do you have permission to access its contents, and what are the contents. So, please type: ls -ld /usr/bin ls -l /usr/bin |
|||||||||||||||||||
|
|
|
|
|
#6 |
|
Prospect
Join Date: Jan 2002
Location: Oklahoma City
Posts: 6
|
pretty long...
Here is the result from each command:
[localhost:~] shawn% ls -ld /usr/bin drwxr-xr-x 125 root wheel 4206 Dec 23 02:32 /usr/bin [localhost:~] shawn% ls -l /usr/bin total 10448 -rwxr-xr-x 1 root wheel 108568 Dec 23 02:29 a2p -r-xr-xr-x 1 root wheel 151 Sep 2 21:09 appletviewer -r-xr-xr-x 1 root wheel 9900 Dec 23 02:29 arch -r-xr-xr-x 1 root wheel 130064 Dec 23 02:29 awk [localhost:~] shawn% Last edited by shawnteague; 01-23-2002 at 01:48 PM. |
|
|
|
|
|
#7 |
|
Site Admin
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
|
You're missing a bunch of stuff. Run the Installer from the CD and install the 'BSD' package. You may need to run the various OS updates again after doing so.
And please try to keep things a little more brief next time. In fact it would be nice if you would edit your post and take most of that out. The 'edit' button is near the bottom right of the message.Thanks! |
|
|
|
|
|
#8 |
|
Triple-A Player
Join Date: Jan 2002
Location: Goolwa, South Australia
Posts: 101
|
How on earth did you manage to lose "top" and "env" from /usr/bin ?
Have you been playing with the rm command ? |
|
|
|
|
|
#9 |
|
Prospect
Join Date: Jan 2002
Location: Oklahoma City
Posts: 6
|
Sorry about the long post, I had no idea how much of that you needed to see! I'll reinstall and see where that gets me.
As far as rm, I think I only used it once to remove a deleted user folder. I'd like to learn more about using the terminal and obviously being more careful when doing so ![]() Thanks for the help Shawn |
|
|
|
|
|
#10 |
|
MVP
Join Date: Dec 2001
Location: Portland, OR
Posts: 1,472
|
I didn't see the unedited list, but it's quite possible that he did not originally install the BSD subsystem. You wind up with a functional but not complete UNIX environment when you do that, and "top" may be one of the things not installed.
-rob. |
|
|
|
|
|
#11 | |||||||||||||||||||
|
Triple-A Player
Join Date: Jan 2002
Location: Goolwa, South Australia
Posts: 101
|
Interesting, however he said that he used to be able to run the "top" command.
|
|||||||||||||||||||
|
|
|
|
|
#12 |
|
Site Admin
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
|
Perhaps that was in 10.0.4, was the BSD subsystem in the default install then?
I don't think it is in 10.1, you have to check the little box to install it. I'd prefer it was the other way around., but Steve and Avie didn't ask me.
|
|
|
|
|
|
#13 | |||||||||||||||||||
|
MVP
Join Date: Dec 2001
Location: Portland, OR
Posts: 1,472
|
Hmm, I missed that part ... yea, not sure if it worked once why it would have vanished after that... -rob. |
|||||||||||||||||||
|
|
|
|
|
#14 |
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
terminal freaking...
This happens when the tcsh system binary becomes corrupt. Reinstall MacOS X over the old installation, or just copy the tcsh binary from another machine.
Cheers... |
|
|
|
![]() |
|
|