You can generate links to a bunch of files using "find":<div><br></div><div>cd /path/to/parent_directory</div><div>find directory_name -type f \( -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' \) | while read filename ; do echo "<a href=\"$filename\">$filename</a>"; done<br>
</div><div><br></div><div>The "-o" means OR, so you can add more file extensions in the find command.</div><div><br></div><div>You can put this output into your HTML if you just want to generate a bunch of links. Or you can use the find command this way to bulk post pictures to some online gallery (e.g. a Drupal or Wordpress site) using curl or wget instead of echo.</div>
<div><br></div><div>Harold</div><div><br><div class="gmail_quote">On Fri, Jul 29, 2011 at 6:46 PM, Darth Borehd <span dir="ltr"><<a href="mailto:darth.borehd@gmail.com">darth.borehd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font size="4">I have a lot of club media files (pictures, videos, and sound) on a drive running Ubuntu 10.04 LTS. I want to share these media files on the Internet. I figure the best way is to make a webpage with links that correspond to the files, so clicking on a link downloads the file or plays it in browser. <br>
<br>The problem is there are thousands of these little files. I tried manually creating links by copying and pasting, but it's taking me to long. <br><br>I tried webmagick, but I found it only works on picture files. Otherwise, it looks to be exactly what I want. <br>
<br>Any suggestions?<br></font>
<br>_______________________________________________<br>
vox-tech mailing list<br>
<a href="mailto:vox-tech@lists.lugod.org">vox-tech@lists.lugod.org</a><br>
<a href="http://lists.lugod.org/mailman/listinfo/vox-tech" target="_blank">http://lists.lugod.org/mailman/listinfo/vox-tech</a><br>
<br></blockquote></div><br></div>