Last active
June 1, 2020 19:18
-
-
Save anon987654321/f76f771709e437962e775be7eff3e91e to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env zsh | |
# | |
# LISTS DIRECTORIES AND FILES | |
# | |
# tree [-a] | |
# | |
# -a Include files | |
# | |
setopt nullglob | |
case $1 in | |
# Directories and files | |
(-a|--all) print -f '%s\n' **/*(e:'[[ -d $REPLY ]] && REPLY=$REPLY/ || REPLY=$REPLY':) ;; | |
# Directories only | |
(*) print -f '%s/\n' **/*(/) ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment