Skip to content

Instantly share code, notes, and snippets.

@Kumquatum
Last active March 29, 2019 12:49
Show Gist options
  • Save Kumquatum/ae2e9f088c4aeddfc49ff2e0646e60f5 to your computer and use it in GitHub Desktop.
Save Kumquatum/ae2e9f088c4aeddfc49ff2e0646e60f5 to your computer and use it in GitHub Desktop.
tree without install
shopt -s globstar
for file in **/*
do
slash=${file//[^\/]}
case "${#slash}" in
0) echo "├── ${file}";;
1) echo "│ ├── ${file}";;
2) echo "│ │ ├── ${file}";;
esac
done
# Usefull with an alias into .bashrc : 'alias tree='sh ~/tree.sh'
# Modified (chars for lines) from https://stackoverflow.com/questions/5732696/centos-directory-structure-as-tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment