Skip to content

Instantly share code, notes, and snippets.

@StudioEtrange
Forked from pravj/treegen.sh
Created January 25, 2018 02:51
Show Gist options
  • Save StudioEtrange/acdf56215ed0eed906df736a0a322033 to your computer and use it in GitHub Desktop.
Save StudioEtrange/acdf56215ed0eed906df736a0a322033 to your computer and use it in GitHub Desktop.
bash script to generate tree structure of a directory
#!/usr/bin/env bash
# bash script to generate tree structure of a directory
# Pravendra Singh (@hackpravj)
pwd=$(pwd)
find $pwd -print | sed -e "s;$pwd;\.;g;s;[^/]*\/;|__;g;s;__|; |;g"

I have a copy of treegen.sh file in /usr/bin with name treegen in executable mode

inside any Directory on running command treegen it result tree structure of that Directory

Download

# basically adding this file to your $PATH in executable mode

cd /usr/bin
wget http://git.io/vEYZ9A && cp vEYZ9A treegen && chmod 755 treegen

Start using it

run treegen command in any directory and it will generate tree structure of directory.

🍻

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