Skip to content

Instantly share code, notes, and snippets.

@arturoherrero
Created March 16, 2014 22:41
Show Gist options
  • Save arturoherrero/9590948 to your computer and use it in GitHub Desktop.
Save arturoherrero/9590948 to your computer and use it in GitHub Desktop.
Directory structure as tree
#!/usr/bin/env bash
shopt -s globstar
for file in **/*
do
slash=${file//[^\/]}
case "${#slash}" in
0) echo "|-- ${file}";;
1) echo "| |-- ${file}";;
2) echo "| | |-- ${file}";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment