Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chrislee8

macrumors regular
Original poster
Jul 26, 2004
102
0
NY, NY
I created a shortcut for a folder at my desktop, the icon has a little curve arrow on it.

in a terminal (bash), I try to do >cd myfolder, it doesn't get into the folder, what do i need to do?

thanks
 

WildCowboy

Administrator/Editor
Staff member
Jan 20, 2005
18,483
2,983
Okay, I'm not a Unix expert (though I should be...I use it enough). The problem you're having is that the shortcut (alias) is not an actual folder, so you can't cd into it. I'm not aware of a way to activate the alias within Terminal to take you to the desired folder...but don't quote me on that.

What you can do is create a Terminal alias and save it to your .cshrc. There's some info on how to that here.
 

jsw

Moderator emeritus
Mar 16, 2004
22,910
44
Andover, MA
The Finder->File->"Make Alias" command is really GUI-only - the actual file is more or less worthless in Terminal.

However, you can make a "real" alias by opening Terminal, typing in
Code:
ln -s
(be sure there is a trailing space), then dragging the folder into Terminal, which will enter the path, so you'll have something like
Code:
ln -s /Users/me/Desktop/Stuff
There will be a trailing space. Finish it with the new location, remembering the path, so it'd end up being a command like:
Code:
ln -s /Users/me/Desktop/Stuff /Users/me/Documents/StuffAlias
Press return.

That'll do the trick; the second name is the alias - it'll be usable via Terminal as well.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
chrislee8 said:
I created a shortcut for a folder at my desktop, the icon has a little curve arrow on it.

in a terminal (bash), I try to do >cd myfolder, it doesn't get into the folder, what do i need to do?

thanks

What you have created is an alias file. An alias file is just a normal file, however, instead of normal data it contains a description where another file or folder can be found. The finder and many applications will read that description and find the right file or folder doing this. Because it is nothing within the file system, alias files "work" for example if you copy everything to another disk, or rename a folder, and so on.

Another method in Unix is to create a "symbolic link". A symbolic link contains a direct connection to another file or folder. In terminal, do "man ln" to see the command that creates unix links. The finder will display unix links exactly the same as alias files. Usually, alias files are the preferred method, because they survive more user actions without problems; a symbolic link will stop working if you move or rename the folder it is pointing to.
 

chrislee8

macrumors regular
Original poster
Jul 26, 2004
102
0
NY, NY
jsw said:
The Finder->File->"Make Alias" command is really GUI-only - the actual file is more or less worthless in Terminal.

However, you can make a "real" alias by opening Terminal, typing in
Code:
ln -s
(be sure there is a trailing space), then dragging the folder into Terminal, which will enter the path, so you'll have something like
Code:
ln -s /Users/me/Desktop/Stuff
There will be a trailing space. Finish it with the new location, remembering the path, so it'd end up being a command like:
Code:
ln -s /Users/me/Desktop/Stuff /Users/me/Documents/StuffAlias
Press return.

That'll do the trick; the second name is the alias - it'll be usable via Terminal as well.

I sorta remember that when i was playing with linux. thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.