[CentOS] Overwrite target of ln

Michael D. Kralka michael.kralka at kvs.com
Tue Mar 4 23:52:36 UTC 2008


Matt Arnilo S. Baluyos (Mailing Lists) wrote:
> On 05/03/2008, Matt Arnilo S. Baluyos (Mailing Lists)
> <matt.baluyos.lists at gmail.com> wrote:
>> On 05/03/2008, Garrick Staples <garrick at usc.edu> wrote:
>>  I have just tried using a target as a file and it does seem to work
>>  with the -f option. It's only when the target is a directory that it
>>  fails:
>>
>>  $ ll
>>  drwxrwxr-x 2 matt matt 4096 Mar  4 14:34 dir1
>>  drwxrwxr-x 2 matt matt 4096 Mar  4 14:34 dir2
>>  lrwxrwxrwx 1 matt matt    4 Mar  4 14:35 link -> dir1
>>
>>  $ ln -s dir2 link
> 
> That should be:
> 
> $ ln -sf dir2 link

from the ln man page:

-n, --no-dereference
	treat destination that is a symlink to a directory as if it
	were a normal file

Cheers,
Michael



More information about the CentOS mailing list