donkey
donkey

Reputation: 4363

Is it possible to create a universally accessible symbolic link (symlink) in Mac?

As the title states, the question is that normally we can create a symlink via the following command:

ln -s target_path link_path

But I wonder if you can create a symlinc, therefore no matter where you are, you can always cd to this directory.

E.g.

~ user$ cd repos will result in repos user$ _

xyz user$ cd repos will also result in repos user$ _

and repo's absolute directory is ~/Desktop/repos

Upvotes: 0

Views: 110

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207405

You could set a variable in your profile like this:

repos=~/Desktop/repos

Then just use $repos in your scripts and in Terminal

cd $repos

Upvotes: 1

Related Questions