find . -name "*.html" -exec echo "<a href=\"{}\">{}</a><br/>" \; > index_list mv index_list index_list.html # open index_list.html
You need to create an account or log in to post comments to this site.
16794 users tagging and storing useful source code snippets
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
find . -name "*.html" -exec echo "<a href=\"{}\">{}</a><br/>" \; > index_list mv index_list index_list.html # open index_list.html
You need to create an account or log in to post comments to this site.
#!/bin/bash
find . -maxdepth $1 -name "*.$2" -exec echo "{}<br/>" \; > 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.