Results 1 to 1 of 1

Thread: Symbolic Links with Absolute Paths?

  1. #1
    Join Date
    Apr 2010
    Beans
    65

    Symbolic Links with Absolute Paths?

    Is there a way to force ln to convert relative paths to absolute ones? man ln says:
    Code:
    if later resolved, a relative link is interpreted in relation  to
           its parent directory.
    E.g., I want to avoid writing:
    Code:
    ln -s "$(pwd)"/myfile /directory/of/mylink
    and just write:
    Code:
    ln -s myfile /directory/of/mylink
    If I do not include the pwd, resolving it later causes errors. ls -l would say "mylink -> /another/directory/with/myfile" instead of "/directory/of/mylink -> /another/directory/with/myfile". Why is this? Thanks

    Let me do a specific example in case what I wrote above was unclear.
    Code:
    $ ln -s DSC_7071.JPG ~/Desktop/test.jpg
    cd ~/Desktop/
    $ ls -l
    lrwxrwxrwx 1 alan alan 12 2011-07-06 14:52 test.jpg -> DSC_7071.JPG
    Why doesn't it say the following?
    Code:
    lrwxrwxrwx 1 alan alan 12 2011-07-06 14:52 test.jpg -> /directory/in/which/I/ran/ln-s/DSC_7071.JPG
    , where "/directory/in/which/I/ran/ln-s/" is where I ran ln -s? Thanks
    Last edited by Geremia; July 6th, 2011 at 10:56 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •