0

I want to create a symbolic link from Dir1, but only for certain files. Let's say I have these files within Dir1:

file_1.a
file_2.a
file_2.a.b

Now I want to create a symbolic link, but only to those *.a files for which a *.a.b file exists. So in the end it should be a symbolic link only to file_2.a (for this example - I will have few thousands files like this). How should I do this?

marius
  • 1
  • 1
  • Does this answer your question? [How to create a link to a folder in Ubuntu 18.04 using GUI](https://askubuntu.com/questions/1092879/how-to-create-a-link-to-a-folder-in-ubuntu-18-04-using-gui) – user68186 Dec 02 '22 at 15:33
  • @mook765 you're right, it should be either a link to `file_2.a` OR a link to `Dir2` containing `file_2.a`. Whatever is easiest – marius Dec 02 '22 at 15:39
  • @mook765 The link should be created in another directory – marius Dec 02 '22 at 15:49
  • It is still not clear. Do you want to create symbolic links for any file that ends in `.a` or any files that has `.a` in its name (including `file_2.a.b`). You say "*So in the end it should be a symbolic link only to `file_2.a`*". But any file that includes `.a` will include `file_1.a` too. So, the "only to `file_2.a` is not true. Which distro and version of Linux are you using? Add this information to your question. – user68186 Dec 02 '22 at 17:42

0 Answers0