Re: Overwrite target of ln

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Mar 05, 2008 at 07:20:50AM +0800, Matt Arnilo S. Baluyos (Mailing Lists) alleged:
> Hi all,
> 
> Sorry if this seems too basic.
> 
> But is there a way to overwrite the target of a symbolic link without
> first deleting the symlink itself?
> 
> For example, if I have this:
> 
> public_html -> releases/b2b-20080228
> 
> ... and there's a new update, I can then just do the following:
> 
> $ ln releases/site-latest public_html
> 
> I tried using the -f option but it doesn't seem to work as expected.

Your example doesn't have -s?  I assume that was a typo?

Anyways, ln -sf does exactly what you describe.

$ ls -l foo
lrwxrwxrwx  1 garrick rds 3 Mar  4 15:24 foo -> bar
$ ln -sf bar2 foo
$ ls -l foo
lrwxrwxrwx  1 garrick rds 4 Mar  4 15:24 foo -> bar2

-- 
Garrick Staples, GNU/Linux HPCC SysAdmin
University of Southern California

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Attachment: pgpxmnLSe3xQE.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux