I am glad that relative symlinks are possible in Linux, namely ln -s -r linked/directory linkingfile, but it is taking me quite a long time on terminal to do the job of relative linking many files.

I know, I can create symlinks with Nautilus quite comfortably: I drag the linked directory or file pressing Ctrl+Shift wherever I want to place the link. However the symlink is absolute.

Is there any possibility on Nautilus to create relative symlinks by dragging and dropping or even with context menus?



I can't provide a very useful answer, that won't need a lot of additional creativity. But I was able to do this with filemanager-actions...
This may help for a visual aid and some config help-> Combine JPG and MP3 to MP4 using FileManager-Actions and shell script (Ubuntu 18.04)

Under the "Command" tab I put the /usr/bin/ln -s -r command. And the parameters I took in a single file URI and a separate (manual) directory to store the link along with the single file's basename with "link" appended to it. The parameters looked like %F /home/wu/%b-link.

Then you right-click on the file you are linking and select the script name and it creates the "filename-link" link in /home/wu...

Not very useful as I did it, as the destination is so predetermined... but you can create your own script to execute... It would be nice if you could easily use the feature of selecting multiple entries... like a file and a folder... then you could tell it to make the link to the selected file, inside the selected folder... The problem I had with this before, was that it reads what you have selected in alphabetical order, regardless of the order you select them in... I'm no expert in this application, so there are probably some features I just don't know how to use... but you could probably come up with a way to create workarounds by calling your own scripts...

...for instance... select a folder and a file: then call your script that loops through your selections and test -d $selection (tests whether it is a folder or not)... then inside your script run your /usr/bin/ln -s -r $filename $folder/$filename-link...

Like I said, you would have to get a little creative, but you would be able to at least use the right click menu within nautilus.

| improve this answer | |
  • I appreciate you answering my question. Sadly, at the moment, I am still using 16.04 LTS. Could you try to be clearer in your solution? That is, present in order the steps of your solution, with well-defined operations. For example, 1. Select A in menu B, 2. Edit C in file D, ... Your answer looks too verbose to me. ;) – loved.by.Jesus Nov 15 at 16:48
  • 1
    I probably shouldn't have provided this as an answer... i would have left it as a suggestion in a comment, except it actually worked and it was too much to leave in a comment... My suggestion was to use a program called filemanager-actions. sudo apt-get install filemanager-actions and as I indicated on the other link, also install nautilus-actions and nautilus-extension-fma. This program allows to create customized right-click menu options. Meaning you can put your own commands in the menu and right click on a file and execute those commands. – WU-TANG Nov 15 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.