Skip to content

Instantly share code, notes, and snippets.

@anon987654321
Last active June 1, 2020 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anon987654321/f76f771709e437962e775be7eff3e91e to your computer and use it in GitHub Desktop.
Save anon987654321/f76f771709e437962e775be7eff3e91e to your computer and use it in GitHub Desktop.
#!/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