I want to make symlinks of all files in a directory EXCEPT the existing symlinks in the directory The 2019 Stack Overflow Developer Survey Results Are InCreate a symbolic link relative to the current directoryFind all symlinks to a directory and change target to another directorySymlink all files in a directory with the entire directory treeFind all dirs/files that have symlinks pointing to them?How do I remove all files from wtihin a certain directory except for a child directory of that directory?Does `ln -sf` overwrite existing files which are only symbolic linksWhy change the current directory to the parent directory of a relative symlink before creating itHow can I copy a directory structure but ignore symlinks?Symlinking all dot-files and -directorieszip command show warnings “name not matched” about symlinks, outside of my working directory, pointing to non-existing target
What information about me do stores get via my credit card?
How to charge AirPods to keep battery healthy?
Kerning for subscripts of sigma?
Did any laptop computers have a built-in 5 1/4 inch floppy drive?
Can withdrawing asylum be illegal?
Why “相同意思的词” is called “同义词” instead of "同意词"?
Does HR tell a hiring manager about salary negotiations?
Is an up-to-date browser secure on an out-of-date OS?
How did passengers keep warm on sail ships?
Can a flute soloist sit?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Why can't devices on different VLANs, but on the same subnet, communicate?
Is Cinnamon a desktop environment or a window manager? (Or both?)
Match Roman Numerals
How can I define good in a religion that claims no moral authority?
What is the meaning of Triage in Cybersec world?
Why isn't the circumferential light around the M87 black hole's event horizon symmetric?
What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?
Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?
How do I free up internal storage if I don't have any apps downloaded?
How do you keep chess fun when your opponent constantly beats you?
Can there be female White Walkers?
How to display lines in a file like ls displays files in a directory?
Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?
I want to make symlinks of all files in a directory EXCEPT the existing symlinks in the directory
The 2019 Stack Overflow Developer Survey Results Are InCreate a symbolic link relative to the current directoryFind all symlinks to a directory and change target to another directorySymlink all files in a directory with the entire directory treeFind all dirs/files that have symlinks pointing to them?How do I remove all files from wtihin a certain directory except for a child directory of that directory?Does `ln -sf` overwrite existing files which are only symbolic linksWhy change the current directory to the parent directory of a relative symlink before creating itHow can I copy a directory structure but ignore symlinks?Symlinking all dot-files and -directorieszip command show warnings “name not matched” about symlinks, outside of my working directory, pointing to non-existing target
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a bash script that creates symlinks from the directories in one users directory to another users directory. I want the script to exclude existing symlinks in the source directory when creating symlinks.
bash symlink ln
New contributor
add a comment |
I have a bash script that creates symlinks from the directories in one users directory to another users directory. I want the script to exclude existing symlinks in the source directory when creating symlinks.
bash symlink ln
New contributor
Looks like you're reinventingstow
– muru
Apr 8 at 10:08
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.
– muru
Apr 8 at 10:29
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48
add a comment |
I have a bash script that creates symlinks from the directories in one users directory to another users directory. I want the script to exclude existing symlinks in the source directory when creating symlinks.
bash symlink ln
New contributor
I have a bash script that creates symlinks from the directories in one users directory to another users directory. I want the script to exclude existing symlinks in the source directory when creating symlinks.
bash symlink ln
bash symlink ln
New contributor
New contributor
New contributor
asked Apr 8 at 9:48
David NordenDavid Norden
1
1
New contributor
New contributor
Looks like you're reinventingstow
– muru
Apr 8 at 10:08
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.
– muru
Apr 8 at 10:29
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48
add a comment |
Looks like you're reinventingstow
– muru
Apr 8 at 10:08
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.
– muru
Apr 8 at 10:29
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48
Looks like you're reinventing
stow
– muru
Apr 8 at 10:08
Looks like you're reinventing
stow
– muru
Apr 8 at 10:08
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.– muru
Apr 8 at 10:29
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.– muru
Apr 8 at 10:29
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48
add a comment |
1 Answer
1
active
oldest
votes
you can simply use the -L
operator.
user@debian:~$ touch file
user@debian:~$ ln -s file link
user@debian:~$ ls -l
total 8
-rw-r--r-- 1 user user 0 avril 8 12:01 file
lrwxrwxrwx 1 user user 4 avril 8 12:01 link -> file
user@debian:~$ if [[ -L file ]]; then echo "it's a link"; fi
user@debian:~$ if [[ -L link ]]; then echo "it's a link"; fi
it's a link
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
David Norden is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511193%2fi-want-to-make-symlinks-of-all-files-in-a-directory-except-the-existing-symlinks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
you can simply use the -L
operator.
user@debian:~$ touch file
user@debian:~$ ln -s file link
user@debian:~$ ls -l
total 8
-rw-r--r-- 1 user user 0 avril 8 12:01 file
lrwxrwxrwx 1 user user 4 avril 8 12:01 link -> file
user@debian:~$ if [[ -L file ]]; then echo "it's a link"; fi
user@debian:~$ if [[ -L link ]]; then echo "it's a link"; fi
it's a link
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
add a comment |
you can simply use the -L
operator.
user@debian:~$ touch file
user@debian:~$ ln -s file link
user@debian:~$ ls -l
total 8
-rw-r--r-- 1 user user 0 avril 8 12:01 file
lrwxrwxrwx 1 user user 4 avril 8 12:01 link -> file
user@debian:~$ if [[ -L file ]]; then echo "it's a link"; fi
user@debian:~$ if [[ -L link ]]; then echo "it's a link"; fi
it's a link
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
add a comment |
you can simply use the -L
operator.
user@debian:~$ touch file
user@debian:~$ ln -s file link
user@debian:~$ ls -l
total 8
-rw-r--r-- 1 user user 0 avril 8 12:01 file
lrwxrwxrwx 1 user user 4 avril 8 12:01 link -> file
user@debian:~$ if [[ -L file ]]; then echo "it's a link"; fi
user@debian:~$ if [[ -L link ]]; then echo "it's a link"; fi
it's a link
you can simply use the -L
operator.
user@debian:~$ touch file
user@debian:~$ ln -s file link
user@debian:~$ ls -l
total 8
-rw-r--r-- 1 user user 0 avril 8 12:01 file
lrwxrwxrwx 1 user user 4 avril 8 12:01 link -> file
user@debian:~$ if [[ -L file ]]; then echo "it's a link"; fi
user@debian:~$ if [[ -L link ]]; then echo "it's a link"; fi
it's a link
answered Apr 8 at 10:03
BDRBDR
1115
1115
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
add a comment |
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
Thanks, but it seems that option is not available on MacOS..
– David Norden
Apr 8 at 10:22
add a comment |
David Norden is a new contributor. Be nice, and check out our Code of Conduct.
David Norden is a new contributor. Be nice, and check out our Code of Conduct.
David Norden is a new contributor. Be nice, and check out our Code of Conduct.
David Norden is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511193%2fi-want-to-make-symlinks-of-all-files-in-a-directory-except-the-existing-symlinks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Looks like you're reinventing
stow
– muru
Apr 8 at 10:08
Thanks, I am not familiar with stow, is that similar to "install"? Also, I am on MacOs, so stow is not available for me right now. I will check it out.
– David Norden
Apr 8 at 10:24
stow
is much more. It's used for managing symlinks to files from one directory to another. Lets you add, update, remove groups of symlinks. It's available via homebrew.– muru
Apr 8 at 10:29
Ok, I will try it out, thanks for the tip!
– David Norden
Apr 8 at 10:47
I think I have to find another approach. Is there a way to find and remove files with a pattern like this (where the pattern is only that there are two underscores in the filename, separated by letters or numbers) file_name_name
– David Norden
Apr 8 at 14:48