PDA

View Full Version : access to folder shortcut




chrislee8
Aug 18, 2006, 08:59 PM
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
Aug 18, 2006, 09:27 PM
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 (http://support.uchicago.edu/docs/misc/unix/tutorial/basicc.html).

chrislee8
Aug 18, 2006, 09:36 PM
i thought there would be a more convenient way to do that.

oh well, thanks though

jsw
Aug 18, 2006, 10:05 PM
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 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 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:ln -s /Users/me/Desktop/Stuff /Users/me/Documents/StuffAliasPress return.

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

gnasher729
Aug 19, 2006, 06:17 AM
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.

kainjow
Aug 19, 2006, 03:07 PM
I hope Tiger's Finder abandons the alias and uses symbolic links instead.

chrislee8
Aug 21, 2006, 02:19 PM
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 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 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:ln -s /Users/me/Desktop/Stuff /Users/me/Documents/StuffAliasPress 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