Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently downloaded and installed scala(tried to anyway) and just noticed that commands in terminal are not found.. I was tinkering with my path variable so I assume that is the problem...

I was reading around and saw that all of those commands should be in /usr/bin directory.. so if i type /usr/bin/ls into terminal i should still get a list. But I can't seem to find any of those commands (ls, mv, cp, etc).. they are just nowhere to be found

Does anybody know how to fix this? thanks!

share|improve this question

migrated from stackoverflow.com Jun 9 '11 at 6:29

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers

Not a fix, but most of those commands are found in /bin, not /usr/bin.

share|improve this answer
All of the three are. –  Daniel Beck Jun 9 '11 at 6:36
add comment

ls is in /bin

you need to modify the PATH environment variable to include the bin directory of your scala install.

for example, to add all the android sdk commands to my path, i put

export PATH=${PATH}:~/sdks/android-sdk-mac_86/tools

in my ~/.bash_profile

Be very careful when modifying the path. If you do it wrong, you will lose access to a lot of the system commands.

share|improve this answer
add comment

Put /bin in your path by running this command:

export PATH=$PATH:/bin

All these binaries exist in /bin under Mac OS.

share|improve this answer
add comment

if you add additional packages to your mac, there are some locations, which make the most sense, so that all users can use them.

These are /opt and /usr/local

I prefer /opt as does for example MacPorts.

So, to install Scala do the following

  • Download Scala and unpack
  • sudo mkdir -p /opt/scala
  • sudo chown -R YOUR_USERNAME /opt/scala
  • move contents from unpacked folder to /opt/scala, so that the structure will have a /opt/scala/bin folder

Now you have installed Scala. Next, you have to edit your PATH accordingly so that you can call the files in /opt/scala/bin from everywhere:

  • Edit ~/.profile and add these lines

    export SCALA_HOME=/opt/scala

    export PATH=${SCALA_HOME}/bin:${PATH}

Now either close all Terminal windows and reopen them or in the window you have still open do a source ~/.profile

When you restart your Mac, your .profile will automatically be sourced. So the third option would be just to restart your Mac. :-)



share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.