Re: [linux-audio-user] Re: batch creation of symlinks

From: Hans <hansfong@email-addr-hidden>
Date: Sun Jul 09 2006 - 22:22:18 EEST

That is a good one! I have a feeling I'm going to use this one a lot,
because it makes sense. Thanks! --Hans

Phil Mendelsohn wrote:

>>Date: Sat, 08 Jul 2006 22:15:23 +0200
>>From: Hans <hansfong@email-addr-hidden>
>>Subject: [linux-audio-user] batch creation of symlinks
>>
>>
>
>
>
>>I want to batch create symlinks in the main directory, of all the files
>>in subdirectories. E.g.
>>
>>$ls
>>dir1
>>dir2
>>dir3
>>file1.mp3 -> .dir1/file1.mp3
>>file2.mp3 -> .dir1/file2.mp3
>>file3.mp3 -> .dir2/file3.mp3
>>file4.mp3 -> .dir2/file4.mp3
>>file5.mp3 -> .dir3/file5.mp3
>>file6.mp3 -> .dir3/file6.mp3
>>
>>I tried various shell thingies like:
>>
>>for i in *.mp3; do ln -s --target-directory=../ $i $i; done
>>
>>in the subdir, or
>>
>>for i in ./dir1/*.mp3; do ln -s $i $i;done
>>
>>
>
>You might find this useful. (cp -s rocks!)
>
>cd $TARGETDIR
>(any loop stuff)
> cp -s $FROMDIR *.mp3 ./
>
>Cheers,
>Phil
>
>
>
Received on Mon Jul 10 00:15:01 2006

This archive was generated by hypermail 2.1.8 : Mon Jul 10 2006 - 00:15:02 EEST