Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I cd to an alias directory in the Mac OSX terminal

Tags:

bash

macos

Is there a way to get into an alias directory from shell with the command "cd" ? It always returns that "htdocs" isn't a directory.

Edit: I made the shortcut with the OS GUI -> rightclicked the htdocs directory and chose "Alias..." (i'm using a german OS if it's not alias maybe it's called shortcut in english?) then i moved it to my home directory (because my terminal starts from there when i open it).

All i want is to open my terminal and type "cd htdocs" so that i can work from there.

like image 478
codepushr Avatar asked Oct 16 '11 00:10

codepushr


People also ask

How do I cd into a directory in Mac terminal?

If you type cd .. (that's two periods), you'll go to the directory above the one you're currently in. So if you're in your home folder, and type cd .. , you'll go to your Mac's /Users folder. And if you type cd - (hyphen) you'll go back to the directory you were in before the last time you issued the cd command.

How do I create an alias disk on a Mac?

Create an aliasSelect the item, then choose File > Make Alias. You can create as many aliases for an item as you want, then drag them to other folders or to the desktop. Press Option-Command while you drag the original item to another folder or to the desktop to create an alias and move it in one step.

How do you go to one directory on a Mac?

Double-Click on any of the folders/directories in the list and Finder will go to that location. The directory path is not shown by default; to show it, choose View menu > Show Path Bar. Thats right, thank you. Double-click on the directory in the Path Bar to go to that location.


1 Answers

you can make symbolic link to it.

ln -s EXISTING_PATH LINK_NAME 

e.g.

ln -s ~/Documents/books ~/Desktop/ 

Reference

Enter into a directory through an alias in Mac OS X terminal

like image 133
Marvin W Avatar answered Sep 29 '22 01:09

Marvin W