Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

$mkdir lnTest1 lnTest2

$ln -s lnTest1 "lnTest2" There is NO slash at the end of "lnTest2"!!

$ls lnT* -Rl |sed "s'$USER''g"
lnTest1:
total 0

lnTest2:
total 0
lrwxrwxrwx 1   7 Jun 22 22:48 lnTest1 -> lnTest1
share|improve this question
    
what is the question? –  Oxinabox Jun 23 at 2:12
    
I was trying a way to ask a question without wording it :) –  Aquarius Power Jun 23 at 3:51

1 Answer 1

up vote 4 down vote accepted

When the last argument to ln is a directory, the links are made in that directory. The man page says:

SYNOPSIS

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

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

It doesn't matter whether you're creating a hard or symbolic link. cp and mv behave similarly.

share|improve this answer
    
I think than an alias ln='ln -T' could be a workaround, but then it would fail if I want an actual directory be recognized as such; And even if I use / at the end, it still doesnt accept the directory... so the best is know about -T ln option and use it properly, I just saw cp and mv have the same option for the exactly same purpose, thx! –  Aquarius Power Jun 23 at 3:56

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.