Create multiple soft links with one command

Feb 28, '02 01:30:54AM

Contributed by: Greg

I recently had to make soft links to about 50 files. The shell was not expanding the wildcard (*) symbol as expected. The syntax for doing this with the 'ln' command is:

ln -s source_file target_file
After some experimentation I found the following works perfectly.
ln -s /path/to/source/* /path/to/target/directory/
This resulted in the wildcard being expanded into each of the file names and a soft link being made to each of the files in my target directory.

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020228013054899