Score:0

How to create a symbolic link to certain files within a directory?

bv flag

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?

ar flag
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)
marius avatar
bv flag
@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 avatar
bv flag
@mook765 The link should be created in another directory
ar flag
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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.