How to create an alias from the command line

Hi
I would like to know how to create an alias (for a file, not a command) from the command line. I don't want to use the ln command, as an alias has more interesting features than soft/hard links... Is there an Apple specific tool to do this?

Thanks
-Jerome

Mac OS X (10.4.10)

Posted on Jul 13, 2007 7:26 AM

Reply
2 replies

Jul 13, 2007 8:59 AM in response to jeromedroz

The only straightforward way that I am aware of for creating a "Finder" alias from the command line is using AppleScript via ' osascript'. Of course, it's not really a command line solution since the "Finder" has to be running. Anyway, something along the lines of:
<pre style="overflow:auto; padding: 5px; width: 500px ; font-size: 10px; border:1">osascript -e 'tell application "Finder" to make alias file to POSIX file "/full/path/to/file" at POSIX file "/full/path/to/folder"'</pre>

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to create an alias from the command line

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.