Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 5 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .