Monday, May 6, 2024
71
rated 0 times [  71] [ 0]  / answers: 1 / hits: 533296  / 3 Years ago, wed, october 27, 2021, 2:27:17

I'm trying to create a symlink in my home directory to a directories and files on my data partition. I've tried:



~/Documents$ ln -sv ~/Documents/saga /media/mariajulia/485f3e29-355c-4be3-b80a-1f5abd5604b6/mariajulia/Downloads/saga..doc


to create a symlink named saga in my Documents directory in my home folder. The terminal output is:



ln: failed to create symbolic link ‘/media/mariajulia/485f3e29-355c-4be3-b80a-1f5abd5604b6/mariajulia/Downloads/saga..doc’: File exists


I was checking the content of ~/Documents with ls -a , there is nothing but . and ... In general my home folder is empty, it's just a fresh system installation.


More From » symbolic-link

 Answers
3

This is a classical error... it's the other way around:



ln -s Existing-file New-name 


so in your case



ln -sv /media/mariajulia/485f3e29-355c-4be3-b80a-1f5abd5604b6/mariajulia/Downloads/saga..doc ~/Documents/saga 


should work. Note though:




  1. if ~/Documents/saga exists and is not a directory, you will have the error too;


  2. if ~/Documents/saga exists and is a directory, the symbolic link will be ~/Documents/saga/saga..doc (are you sure about the double dot?)


  3. if ~/Documents/saga does not exists, you symbolic link will be ~/Documents/saga (as it is, no extension).



[#22616] Thursday, October 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scrubuz

Total Points: 194
Total Questions: 96
Total Answers: 127

Location: Monaco
Member since Fri, Sep 24, 2021
3 Years ago
;