Mac OS X Terminal get in Macintosh HD? For using Git and Github

githigh-definitionmacterminal.app

I wanted to get started with using Git and Github especially for installing Web software to my htdocs directory. htdocs is the folder in which you put all your websites that then run by using MAMP — Apache server, PHP, MySQL and stuff.

This not the real problem though, the problem is I am in the terminal and see this:

imac-van-jeroen-*******-2:~ JeroensiMac$ 

And using cd ~ or cd .. just results back in the line above, which is usual.

The problem is that all my applications and everything really is not on my user but in the Macintosh HD.

Macintosh HD/applications, or Macintosh HD/applications/MAMP/htdocs/

I want to be in the Terminal and go to my Macintosh HD (is this referred to as being superuser?).

I want to know if this is just my fault for installing everything on my Macintosh HD instead of Macintosh HD/users/JeroensiMac/~. Also I would like to know if its possible at all, and I am just missing something.

And If I am not doing anything wrong
is it safe to use Git(Github) with directories in my Macintosh HD?

Best Answer

When you open Terminal, you start out in /Users/username/, or, in short, ~. This is the same path as Macintosh HD:Users:username.

cd .. from there brings you to the parent directory /Users, or Macintosh HD:Users.


To get to Macintosh HD (which is the same as / in Terminal), enter

cd /

Your other disks are mounted in /Volumes/ (which is not visible from the Finder).


The Finder's Go to Folder... menu item uses the Unix paths (i.e. those starting with /), so it's useful to know these even if you're not often using the Terminal.


Superuser on Mac OS X refers to the root user account used for system administration and has little to do with file system paths. It's possible that your user account does not have permissions to write outside your home directory, that's what the lock icon and button are for in Get Info dialogs, or when you want to delete something your regular user account doesn't have the permission for:

alt text

You can execute a command as root in Terminal by using sudo or su. Be aware that this is dangerous if you don't know what you're doing!

Related Question