Let's assume the following situation:
-
I have
file1
somewhere$ touch file1
-
I make symbolic link to
file1
assymlink1
:$ ln -s file1 symlink1 $ file symlink1 symlink1: symbolic link to file1
-
I rename
file1
to new name (nowsymlink1
is broken)$ mv file1 file2 $ file symlink1 symlink1: broken symbolic link to file1
After the last step the symlink1
-link is broken.
I know that Midnight Commander has File → Edit symlink option, but it is terminal way:
$ file symlink1
symlink1: symbolic link to file2
and it is very useful if target and symlink are located in different file-systems and/or nested folders.
As far I can see Nautilus, Caja, Nemo, Thunar and Dolphin do not have this functionality.
Update. The most useful solution for me would be integration with Caja file-manager by Caja-actions. I use Caja on daily basis.
Best Answer
Edit Symbolic Link in Nautilus
The script
To do this in Nautilus we need to create a script using:
Paste in the following:
and make it executable
Sample output
This is the test data used. The second last section shows the broken link. Then our script is run giving a new file name. The last section shows the new good link.
Sample screen
This is what the script looks like when you run it:
Scripts
edit-link
Edit Symbolic Link in Caja
The method is similar to Nautilus but with some Caja specifics. We should follow GNOME2→MATE Migration guide.
So we need create script in the
~/.config/caja/scripts
:and make it executable
Then we can use this script from Caja Scripts drop-down menu.