Can one create an “Alias” via Terminal?

Discussion in 'Mac OS X System & Mac Software' started by simbalala, May 14, 2008.

  1. simbalala

    simbalala Registered

    Joined:
    Jul 22, 2005
    Messages:
    1,038
    Likes Received:
    1
    Trophy Points:
    0
    I needed an alias from a PrefPane in my user area. I figured a symlink would do. So in Terminal I did a ln -s with the proper user directory and all looked good, it appears.

    But the system threw an error when I tried to click it. It offered to repair the “alias” or delete it, so I opted to repair it, still didn’t work, errors. I tried twice then threw in the towel, enabled root, logged into the GUI and created an alias the normal way, that’s fine.

    I’m still wondering about the command line procedure though. It would be a link from a user area to an area owned by root and I’m guessing that’s the issue.
     
  2. Mikuro

    Mikuro Crotchety UI Nitpicker

    Joined:
    Mar 21, 2005
    Messages:
    2,843
    Likes Received:
    7
    Trophy Points:
    38
    Why did you need to enable root to create the alias? You should be able to make an alias in the Finder as any account. Does your account not have read access on your /System folder? Edit: I just remembered that the "Make Alias" command is dimmed without write access. In case you don't know, you can make aliases anyway by holding down command and option while dragging a file to another folder you have write access to.

    Both aliases and symlinks work just fine for me. I made the alias in the Finder, the symlinks in Terminal like so:
    Code:
    ln -s /System/Library/PreferencePanes/Appearance.prefPane ~/Desktop
    I'm on 10.5.2, for what it's worth.
     
  3. simbalala

    simbalala Registered

    Joined:
    Jul 22, 2005
    Messages:
    1,038
    Likes Received:
    1
    Trophy Points:
    0
    Because I was peeved.

    Didn’t know about that one.

    Yeah, that works and that’s what I was doing, except I was using sudo. I’m not quite sure what I was doing wrong, but I’d been struggling with something else for quite a while and I was in a hurry.

    Edit: I got a cuter icon the way I did it, looks just like the icon in the preferences panel. So there :cool:
     
    Last edited: May 14, 2008

Share This Page