When a web server does not allow directory listing of files inside, for whatever reasons.
tree command can be used to generate a simple index.html file, that lists the contents of your directory, which can then be used to browse the contents of your directory from web server.
tree -H '.' -L 1 -P "*.html" --noreport --prune -T "Doc title" > index.html
Above command will generate a simple index.html file which contains the link to all .html files in your current directory.
-H '.' - enables html output with current directory as the base path.-L 1 - limit directory listing to 1 level deep.-P "*.html" - list only files/directories matching “.html” pattern--noreport - omits file and directory stats at the end of report--prune - removes empty directories from listed in the output.-T "Title" - sets the document and H1 header to ‘Title’ instead of default string.tree command also supports JSON and XML outputs using -J and -X options respectively.
References: