Last active
March 29, 2019 12:49
-
-
Save Kumquatum/ae2e9f088c4aeddfc49ff2e0646e60f5 to your computer and use it in GitHub Desktop.
tree without install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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