Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 115167 - "-f" option ignored by "ln"
"-f" option ignored by "ln"
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
  Show dependency treegraph
Reported: 2004-02-07 10:28 EST by Carlos Rodrigues
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-08 11:39:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Carlos Rodrigues 2004-02-07 10:28:16 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116

Description of problem:
The "-f" ("--force") option in "ln" doesn't seem to have any effect
except supress the error message when the symlink already exists.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. mkdir a b
2. ln -s a c
3. ln -sf b c

Actual Results:  After step 3 the symlink "c" still points at "a".

Expected Results:  It should point at "b", the "f" option should force
the old symlink to be eliminated and the new one to be created
pointing at "b".

Additional info:
Comment 1 Bart Martens 2004-02-08 05:27:00 EST
I think this is not a bug.

$ mkdir a b
$ ln -s a c
$ ln -sf b c
$ ls -l
total 8
drwxrwxr-x    2 bart     bart         4096 Feb  8 11:30 a
drwxrwxr-x    2 bart     bart         4096 Feb  8 11:30 b
lrwxrwxrwx    1 bart     bart            1 Feb  8 11:30 c -> a
$ ls -l c/
total 0
lrwxrwxrwx    1 bart     bart            1 Feb  8 11:30 b -> b
Comment 2 Carlos Rodrigues 2004-02-08 11:39:58 EST
I see what you mean. I didn't notice that the second ln was creating a
symlink called "b" inside directory "c". I almost sure that this
behavior was introduced not long ago as I remember doing the kind of
command sequence indicated above with the results I expected.

The way to get the result I want is by doing "ln -sfn" to avoid
dereferencing the existing symlink. I'm closing this but I feel that
something should be done to make this explicit in the documentation
(at least for those like me that expected the present behavior only
when using "c/" instead of just "c").

Note You need to log in before you can comment on or make changes to this bug.