On 8/20/20 10:22 AM, jdd@dodin.org wrote:
I did them with Dolphin. Given my data structure it's pretty hard to make them in cli :-(
That is like "Tap Dancing On Landmines", or "Playing Russian Roulette". Perhaps I'm just jaded, or perhaps it's from 20 years of Linux experience, but you always want to create a maintain your data layout from the command line. There is never any ambiguity whether absolute or relative links are used, etc.. What you need to do on the new disk is figure out where all the file live relative to your "links directory" and then simply replace all absolute links with relative ones. Use the -f option to overwrite the absolute link with relative ones. E.g. $ ln -sf ../relative/path/to/target linkname You can probably build the list of links with the 'find' command an a '-type d' to select the directories needed and a '-name glob' You probably want to cd /path/on/new/disk/photos Then create a list of the directories you need to link relative to that location (you can redirect the output from find to a 'newlinks' text file if you need to edit it before creating the links). Then just loop over the contents of the 'newlinks' file replacing the symlinks on the new disk: while read -r newlnk; do ln -sf "$newlink" ## name will default to last component of $newlink done < newlinks Or if you want to give each of the symlinks a custom name, edit the 'newlinks' file and add a second column with the custom link name and do: while read -r newlnk lnkname; do ln -sf "$newlink" "lnkname" done < newlinks You can skip the 'newlinks' file an simply replace them all based on the output of `find` if there are no changes or edits needed. You may also be able to use globing "*/*", etc.. instead of find. It just depends on what the layout is. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org