user1988385
user1988385

Reputation: 2869

creating a hard link between two files

If I know that file1 and file2 are the same (they are duplicates), is there anyways that I can replace file2 with a hardlink to file1? I tried to use

ln file2 file1

Is this correct? Thanks.

Upvotes: 1

Views: 673

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21507

ln -f file2 file1

   -f, --force
          remove existing destination files

Upvotes: 1

Related Questions