DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Tree

02.09.2006
| 199 views |
  • submit to reddit
        
#!/bin/sh
# $Id: tree,v 1.1 2003/11/25 14:05:34 rcs Exp rcs $

if [ $# -lt 1 ]
then
   echo "Usage: $0 path1 path2 ... [find-options]"
else
   find $@ -print 2>/dev/null | sed -e 's/[^\/]*\//|-- /g' -e 's/-- |/    |/g'
fi

### EOF