Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on a Mac and watching a tutorial on setting up Git.

I'm in the terminal and currently on the Desktop. I can us ls to list all the items on my desktop, and cd into any of the folders on my Desktop, but I can't get into my localhost shortcut (which leads to the MAMP folder in applications where all my websites are).

Error message:

enter image description here

1) How do you navigate into a shortcut, or

2) How do you navigate into the Main Mac folder (I can't see or cd into it from the terminal)

share|improve this question
    
file localhost says...? – Ignacio Vazquez-Abrams May 18 '13 at 5:54
    
when I type that in, it displays 'data' – Leon Gaban May 18 '13 at 5:55
    
Did you mean to create it as a symlink initially? – Ignacio Vazquez-Abrams May 18 '13 at 5:55
    
Not sure what that means, I just put a shortcut there, because I'm too scared of accidentally deleting my projects folder. So a shortcut makes it safer :) Do I need to remake the shortcut / alias? – Leon Gaban May 18 '13 at 5:56
    
I would remove the shortcut and create a symlink instead. – Ignacio Vazquez-Abrams May 18 '13 at 5:57
up vote 2 down vote accepted

In order to get to the Main Mac folder, you can do cd /

share|improve this answer
    
Thanks! I can now cd into my Applications > MAMP folder :) – Leon Gaban May 21 '13 at 5:06

Using Terminal

ln -s /Applications/source/path /Users/name/target/path

which in your case (if I've understood correctly) should be

ln -s /Applications/MAMP ~/Desktop/localhost

which will create a symbolic link on your Desktop which will be accessible both through the finder and by entering cd localhost while in ~/Desktop.

If you only need this link for quick access via Terminal, I would recommend placing it into your home folder which would allow you to access it by entering cd localhost as soon as you open a new Terminal shell.

share|improve this answer
    
Just tried that again, and can't CD into an alias :( – Leon Gaban May 21 '13 at 5:06
    
Yeah, sorry, my answer was wrong, I revised it. – Francesco Zeno May 21 '13 at 8:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .