Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Add this to your .bashrc or .zshrc or wherever
- # Copyright (C) 2012 by Adam Katz <http://www.khopis.com/scripts>, GPLv3+
- # see also http://www.commandlinefu.com/commands/view/10592/
- function tree() {
- local dirs_only=''
- case $1 in
- -d ) dirs_only="-type d"; shift ;;
- -?* ) [ ! -r "$1" ] && echo "Usage: tree [-d] [PATH...]" && return 1 ;;
- esac
- find "${@:-.}" $dirs_only |sed 's:[^-][^/]*/:--:g; s/^-/ |/'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement