Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The command in question is:

sudo ln -s /usr/lib/x86_64-linux-gnu/foo.so /usr/lib/

I read this article about ln, which indicates that the latter argument can be either a name or a directory. In this case, with it being a directory, my assumption is that the above command causes access to /usr/lib/foo.so to be directed to /usr/lib/x86_64-linux-gnu/foo.so. If that's true, what is the value in omitting the name in the latter argument vs explicitly including the name (e.g., /usr/lib/foo.so)? Is this just a common shortcut, or is there a value in doing this? Also, does creating the symbolic link in this way have any other effect that it wouldn't if the name was included in the latter argument?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The purpose of omitting the name is that you will save time typing, considering that you may have multiple targets specified. See the manual.

ln [OPTION]... TARGET... DIRECTORY (3rd form)

In the 3rd and 4th forms, create links to each TARGET in DIRECTORY

share|improve this answer
    
The value is in being able to create a ton of differently named links in the same directory. –  Daniel Beck Nov 28 '12 at 15:07
    
@DanielBeck - does this mean that I can use ln -s /usr/bin/foo1.so /usr/bin/foo2.so /usr/bin and it will link both foo1.so and foo2.so? The use of simply TARGET in the man page makes me think I can only provide one target at a time. –  orokusaki Nov 28 '12 at 15:10
    
@orokusaki Yes. That's what the ... means. –  Daniel Beck Nov 28 '12 at 15:15
    
Well you asked what is the value in omitting the name.... –  Goran_Mandic Nov 28 '12 at 15:16
    
Oh snap, I misunderstood you. Hahah, I get it now. Hopefully you do too? –  Goran_Mandic Nov 28 '12 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.