DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Create An Index Of A Tree Of Html Files For Local Viewing.

11.20.2008
| 5101 views |
  • submit to reddit
        
find . -name "*.html" -exec echo "<a href=\"{}\">{}</a><br/>" \; > index_list
mv index_list index_list.html
# open index_list.html
    

Comments

Snippets Manager replied on Mon, 2009/02/16 - 9:48pm

How about making this a nice bash executable. #!/bin/bash find . -maxdepth $1 -name "*.$2" -exec echo "{}
" \; > list_$2.html Now you can enter 2 variables to make a custom page for each file type. eg: [~]# list_tree 2 pdf This will create the file 'list_pdf.html' of only the pdf files in the current directory and one directory underneath.