bash symlink everything in a directory 1

bash symlink everything in a directory

# Basic syntax:
ln -s /path/to/directory/* /path/to/symlinks/
# Where:
#	- The /path/to/directory/ is where the real files are stored
#	- The /path/to/symlinks/ is where the symlinks will be created
#	- -s means symlink
# Note, I also like to add the -f and -i flags which remove existing
#	destination files and prompt before replacement

Here is what the above code is Doing:
1. Create a directory called “symlinks”
2. Create a symlink to each file in the “files” directory
3. Print the contents of the “symlinks” directory

Similar Posts