The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

HTML directory listings

Contributed by: Hans van der Maarel
This tip is valid for: Both BeOS and Haiku

If you want to create a directory listing in HTML format, paste this shell script into a text editor and save it to /boot/home/config/bin/dirlist:


echo <html><head></head><body> >
 dirindex.html

ls -1 | awk '{print "<a href="" $0 "">" $0 "</A><BR>"}'
 >> dirindex.html

echo </body></html> >> dirindex.html

Open a Terminal, cd to any directory, and run dirlist. You’ll end up with an HTML document in that directory called dirindex.html containing hyperlinks to all the files in the directory.

Posted in Miscellaneous


(comments are closed).