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 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?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

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!

share|improve this answer
1  
Would it be safe to use git with these directories? –  Jeroen Jan 16 '11 at 17:03
    
@Jeroen Explain what you mean by "use git". Do you want to put your whole system disk under version control? –  Daniel Beck Jan 16 '11 at 17:11
1  
I am learning steadily about git and github, but what I wanted to do is to get into the 'htdocs' folder. Which means I can run websites on my localhost. The problem was I wanted to push changes using git(to the github repositories), or fork some project — being a web project — I wanted this to be in the 'htdocs' folder so I could use it. And what you showed me was how to get in this directory '/Applications/MAMP/htdocs/'. The thing I wondered in my previous comment, if this directory is a save directory to use git with(maybe I am just being stupid now). Appreciate your explanation! –  Jeroen Feb 28 '11 at 23:09
    
@Jeroen You can, if what git gives you is the proper directory structure. But it'll be visible to all users of your machine. If you enable web sharing in System Preferences, you are given a link to your personal directory (http://host/~username). This is how you reach the Sites directory in your home folder. Another option is configuring Apache to provide virtual hosts, you can e.g. set up to serve any folder on hostname:81 or so. There's plenty of documentation for that online. –  Daniel Beck Mar 1 '11 at 5:14
add comment

If you want to get into your Macintosh HD, you'll have to replace the Macintosh HD with simply /. For instance.

/Applications
/Applications/MAMP/htdocs/
share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.