Created
March 9, 2023 13:15
-
-
Save skurscheid/8e8f41b4dfed2653966d7e1c934ecf24 to your computer and use it in GitHub Desktop.
create_symbolic_links_from_directory_content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#this command takes the list of all files in the current directory, | |
#excludes all files that contain "Undetermined" in their filename | |
#gets the realpath for the given file | |
#and creates a symbolic link in the $newpath | |
export newpath="/this/is/the/new/path" | |
ls . | grep -v Undetermined | xargs -d $'\n' sh -c 'for arg do path=$(realpath "$arg"); ln -s ${path} ${newpath}"$arg"; done' _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment