Symlink all files in a Folder to a new Folder

2

Ideally what I am seeking is a way to rename all my anime keeping original files intact without using extra data space

The solution I can think of is creating a duplicate folder path to another location and then symlinking each file into the new duplicated folder path for renaming for media scraper to identify them

My question is how to create a symlink of every file in a folder to a new location.

Using FreeBSD 9, the following did not work for me :

cd ../bar
cp --symbolic-link ../foo/* .

Doing individually ( however that was with file rename which is not needed for now )

ln -s "/ZFSRaidz/Multimedia/Anime/Naruto_Shippuuden/[HorribleSubs] Naruto Shippuuden - 244 [480p].mkv" "/ZFSRaidz/XBMC/Multimedia/Anime/Naruto_Shippuuden/Naruto Shippuuden-244.mkv"

MasterCATZ

Posted 2012-05-28T00:39:44.453

Reputation: 23

Why per file and not at the folder level? – None – 2012-05-28T00:48:04.407

Answers

4

If you don't need to do a rename, then the following will symlink every file in a folder to a new folder:

ln -s /ZFSRaidz/Multimedia/Anime/Naruto_Shippuuden/* /ZFSRaidz/XBMC/Multimedia/Anime/Naruto_Shippuuden-2/

This will create a symlink in the Naruto_Shippuuden-2 for each file in Naruto_Shippuuden

Paul

Posted 2012-05-28T00:39:44.453

Reputation: 52 173

Thank you very much I had tried ln -s /ZFSRaidz/Multimedia/Anime/Naruto_Shippuuden/* /ZFSRaidz/XBMC/Multimedia/Anime/Naruto_Shippuuden/* – MasterCATZ – 2012-05-28T14:19:16.877

I removed that * and it worked. The reason for not doing the folder is the whole reason being I needed to rename the files from absolute numbering, e.g. 244 to s12e2 with out effecting my archiving. – MasterCATZ – 2012-05-28T14:25:44.540