Recent Files and Creating Symbolic Links

Jon Moss jon.moss at cnonline.net
Sun Mar 6 20:42:01 CST 2005


Thanks for both suggestions.  I will try both of them.

Have a great week!

Jon Moss

> On Sun, 6 Mar 2005, Jonathan Hutchins wrote:
>
>> Rather than pipe the output to a text file, use the "exec" option of
>> find to
>> execute the symlink command - something like
>>
>> find /path/ -mtime 48 -name '*.jpg' -exec -s /path/{} WhatsNew/{} \;
>
> While not as elegant as Jonathan's solution, the following has the
> advantage or totally regenerating the new picture links when it is run -
> first cd to the directory with your photos:
>
> ----8<-------------------------------
> #! /usr/bin/perl
> system("rm -r newpix; mkdir newpix");
> (@newpix)=qx (find . -mtime -3 -name '*.jpg');
> print "@newpix\n";
> foreach $_ (@newpix) {
>     chomp ($link =($_));
>     $newlink = "newpix/$link";
>     system ("ln -s '$link' '$newlink'");
> };
>
> print "\n\nDone.\n";
> exit;
>
> ---->8---------------------------
>
> This will link to files created in the last 36 hours, the -3
> (days) argument to mtime.
>
>
>
> Regards,
>
> -Don

-- 
Thanks very much,

Jon Moss
jon.moss at cnonline.net


More information about the Kclug mailing list