Skip to content

Instantly share code, notes, and snippets.

@dukeofgaming
Created June 9, 2014 04:08
Show Gist options
  • Save dukeofgaming/972288f2d997bacdc130 to your computer and use it in GitHub Desktop.
Save dukeofgaming/972288f2d997bacdc130 to your computer and use it in GitHub Desktop.
Directory Tree when there is no tree command
find . -type d -print 2>/dev/null|awk '!/\.$/ {for (i=1;i<NF;i++){d=length($i);if ( d < 5 && i != 1 )d=5;printf("%"d"s","|")}print "---"$NF}' FS='/'
@med36e
Copy link

med36e commented Feb 16, 2020

it really works
my i ask you why did you put '!/.$/ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment