3

I wanted to make a shortcut at my root, entry Terminal directory

Goal

an Alias for /someLongPath/someProject/ at ~/someProject

Problem

I create the Alias and locate it at ~/. For me this is ~/MultiTimer here. But for the Alias, the Terminal use of cd does not work!

terminal screenshot

Question

How do you use cd from the Terminal for an Alias? Can this be setup?

3
  • 1
    Please do not update your question to include the answer directly, post an answer below instead. Including answers directly in questions confuses both the search function and other users (and makes it kind of hard to upvote/accept an answer).
    – nohillside
    Commented Jan 7, 2016 at 14:57
  • good call - yikes I'm on it ;0!
    – J-Dizzle
    Commented Jan 7, 2016 at 14:57
  • Closely related: apple.stackexchange.com/questions/180762/…
    – nohillside
    Commented Jan 7, 2016 at 14:59

3 Answers 3

4

Aliases are special files for OS X and currently only supported by GUI apps. They contain information about the target object wich allows the finder to find the original location even if the target has been moved across filesystems.

There is some C source to build a tool that gets the target name out of an alias file (Link to source code), but I think to use it in the way you would like (cd) this is not that practical. Ex:

cd `./getTrueName Multitimer`

As mentioned in the first answer, ln is the right tool to use if you don't need the advanced Alias features:

ln -s <sourcepath> <targetpath> does not allow for target movement.

ln <sourcepath> <targetpath> allows for target movement, but only on the same file system.

1
  • your detail and clarity is quite valuable for newbs like me... thanks!!! :)
    – J-Dizzle
    Commented Jan 7, 2016 at 16:28
1

the answer is simple - use 'ln -s' and not an Alias!

0

To use file type "alias" in CLI directly, you should modify the function "cd" in shell.

For example (bash), This tip can be helpful.

You must log in to answer this question.

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