Skip to content

Instantly share code, notes, and snippets.

@crazy-max
Last active August 13, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazy-max/568e52aecd76bed80495270a1cd8e0fe to your computer and use it in GitHub Desktop.
Save crazy-max/568e52aecd76bed80495270a1cd8e0fe to your computer and use it in GitHub Desktop.
List all files and folders of a directory and send it by email
#!/bin/sh
FOLDER="/mnt"
MAIL="root"
tree -ah -H $FOLDER --nolinks -- $FOLDER > /tmp/tree-folder.html
echo "See attachment." | mutt -a "/tmp/tree-folder.html" -s "Tree of $FOLDER on `hostname`" -- $MAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment