Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active August 30, 2017 08:21
Show Gist options
  • Save gbraad/14b19653a7124b4cf86daaa9df736b90 to your computer and use it in GitHub Desktop.
Save gbraad/14b19653a7124b4cf86daaa9df736b90 to your computer and use it in GitHub Desktop.
Generate HTML directory index

Generate directory index

find public/ -type f | ./genindex.sh > public/index.html
ls public/ | ./genindex.sh > public/index.html
#!/bin/sh
echo '<html><body>'
sed 's/^.*/<a href="&">&<\/a><br\/>/'
echo '</body></html>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment