symbolic link - Unix

This is a discussion on symbolic link - Unix ; How can I create a symbolic link to a file ? What I have tried is : ln -s my_file.txt my_sym_link. Then I see that there is my_sym_link. but what I should do next. can I see the original file, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: symbolic link

  1. symbolic link

    How can I create a symbolic link to a file ?

    What I have tried is :
    ln -s my_file.txt my_sym_link.

    Then I see that there is my_sym_link.
    but what I should do next.
    can I see the original file, using only my_sym_link ?

    Thanks



  2. Re: symbolic link

    When my_file.txt and symbolic link are on the same directory - everything
    works fine.

    I write :
    cat my_link,
    and my_file is output to screen, as I did cat my_file.txt

    but if my_link and my_file are not on the same directory, for some reason
    "\" character is ommited
    (when I do : ls -l my_link, there is no "\" seperator that seperates between
    directory and file).

    Why ?

    Thanks



  3. Re: symbolic link

    Mr. X. wrote:
    > but if my_link and my_file are not on the same directory, for some reason
    > "\" character is ommited
    > (when I do : ls -l my_link, there is no "\" seperator that seperates between
    > directory and file).


    Am I missing something? ... The directory separator in U*ix like
    systems has always been "/" (and not "\").

    try ln -s ../somefile symlink

  4. Re: symbolic link

    "Mr. X." wrote:
    # How can I create a symbolic link to a file ?
    #
    # What I have tried is :
    # ln -s my_file.txt my_sym_link.
    #
    # Then I see that there is my_sym_link.
    # but what I should do next.
    # can I see the original file, using only my_sym_link ?

    Could you state that in the form of a question?

    A symbolic link is a relative or absolute path embedded in the file system.
    The existence of a symbolic link does not promise the existence of
    anything at that path, nor does it preserve an inode if all hard links
    are deleted.

    If the symbolic link is an absolute path, it is always the same path.
    If the symbolic link at A/X is a relative path R, it substitutes the
    partial path to get A/R. Because relative path symbolic links can be
    moved, they can end up pointing to different places than originally.

    It's your responsibility to ensure the path is sensible and that there
    always remains a hard link to the inode.

    --
    SM Ryan http://www.rawbw.com/~wyrmwif/
    I love the smell of commerce in the morning.

+ Reply to Thread