(define sixhat (λ (dave) (display 'ideas)))

Working with tree in projects

As a teacher my class folders grow bigger with the pass of time. I keep adding new files, new images, references, etc. Over time this class folders tend to grow large.

For this I like to have a index of certain files in the root of the folder with links for all files of a certain kind. I'm usually interested in source files (either '.key' or '.md') as I mainly work with keynote and markdown files. I'm also interested in '.pdf' files as they are the final product I use.

To build these indices I use the fabulous tree command.

Installation with homebrew

brew install tree

My usage

 tree -H ./ -P '*.pdf' --prune > pdf.html
 tree -H ./ -P '*.md' --prune > md.html
 tree -H ./ -P '*.key' --prune > key.html

This just creates the 3 html files with links for what I need. The -H ./ makes HTML output, the -P ... is the pattern and --prune just avoids printing folders without files in the pattern.