LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 09-27-2006, 09:48 AM   #1
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Rep: Reputation: 30
ln -sf not working??


Hello. If I have a symbolic link:

dir -> dir1

and execute:

ln -sf dir2 dir

dir is unchanged and still points to dir1. I must:

rm -f dir; ln -sf dir2 dir

to do what I want. Do I misunderstand the "-f" option, because I thought a "-f" would force the change to occur. This is on SuSE Enterprise Server 9 via ssh (I do not have a direct console). On a SuSE 9.1, I cannot reproduce this ("ln -f" does relink dir to dir2).

Any ideas? Thanks.

Last edited by registering; 09-27-2006 at 10:05 AM.
 
Old 09-27-2006, 02:23 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The target of your ln is a symbolic link so instead of overwiting the symbolic link itself it directs it to the directory (dir1) to which the symbolic link points. Since it redirects it puts it IN the directory rather than overwriting the link itself.

The whole point in symbolic links is to do this redirection so the above makes sense to me.
 
Old 09-27-2006, 02:41 PM   #3
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks, you're right, I never noticed it was creating the link INSIDE the directory. It looks like if I add the "-n" option (no dereference) it does what I want (i.e., ln -snf). Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
acpi nearly working IBM thinkpad R40e 2684HVG no Fn key working, throttling OK Emmanuel_uk Linux - Laptop and Netbook 2 05-31-2006 01:41 AM
Intel sound not working, usb modem not working. siriusb Linux - Hardware 8 03-04-2006 10:16 PM
F1 - F10 not working when F13 - F20 working in Linux haivinay Linux - General 0 09-20-2004 07:31 AM
F3-F10 is not working when F13-F20 is working in redht-8. haivinay Linux - General 0 09-20-2004 06:39 AM
cannot download files in mozilla -save dialog not working, galeon not working cmisip Linux - General 0 08-03-2003 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 04:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration