-1

I am a windows developer switching over to OSX. I am very confused though. I am learning node.js and the documentation tells me to add a reference to nodemon at the path...

/usr/local/bin/nodemon

However when I am at the terminal and I type 'ls' I get the following output...

enter image description here

And that doesn't have a /usr/ folder ... And what is even more confusing is that if I do...

ls -a

Then I can see all my hidden folder with a folder in called .npm which seems to have all my modules. In windows this is easy it just installs all npm modules into %AppData%/npm or something but I just don't get it on OSX can somebody enlighten me please?

Exitos
  • 29,230
  • 38
  • 123
  • 178
  • The ls is being called in your hime directory. Try 'ls /' – gratz Jun 10 '14 at 20:12
  • `ls`without any parameters lists what you have in the **current** directory. On OSX, this current directory should be something like /Users/your_user_name. To see if you have `nodemon`installed where you think it is, use `ls /usr/local/bin/` – mbarthelemy Jun 10 '14 at 20:12
  • Recommended: [CLI crash course](http://cli.learncodethehardway.org/book/) – toasted_flakes Jun 10 '14 at 20:18

1 Answers1

2

ls lists the directories and files in your current working directory.

You can find your current working directory with pwd (short for 'print working directory')

You can change your current working directory with the cd (change directory) command. In your case, you could run

cd /usr/local
ls

and it would show you the bin directory. Alternatively, you could directly run

ls /usr/local

As a special extra note, the Terminal Prompt itself actually displays the current working directory (by default). In your case, it shows ~, which is shorthand for the user profile directory, which the Terminal opens to automatically. It is generally /Users/<username>.

Brandon Horst
  • 1,921
  • 16
  • 26
  • Brandon this is really helpful, thankyou this would have taken me days to figure out! – Exitos Jun 10 '14 at 20:33
  • Once you know it well, you'll never go back. This is a tutorial that was very helpful to me. [Intro to the Mac OS X Command Line](http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line) – Brandon Horst Jun 10 '14 at 20:34