How to use Terminal to navigate into a desktop shortcut or folder in applications?

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)

6

2 Answers

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

1

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.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like