This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to update the symbolic links

Tags: None
(comma "," separated)
Aenne Lee
Registered Member
Posts
1
Karma
0

How to update the symbolic links

Thu Jan 25, 2018 7:52 am
Hello!

I need to move files to another location and to update all symbolic links to this location. Can any file manager like Dolphin or Konqueror automatically do this for me
airdrik
Registered Member
Posts
1854
Karma
5
OS
So you want the file manager to find and update all symbolic links on the system that were pointing to the old location and update them to the new location? or do you mean update any symbolic links in the files being moved?

In either case I don't know of any file manager that will do that. You could probably do that with scripts. Of particular interest is the "find" command's -lname parameter which allows you to search for symbolic links whose link matches the given pattern. The find command then has a -exec parameter which you can use to evaluate another command for each matching file found.
"find /path/to/directory/with/symlinks/to/update -lname /original/path/* -exec updateLink.sh {} /original/path /new/path ;"
Where updateLink.sh is another script which updates a given link to point from the original path to the new path.


airdrik, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]