Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!van-bc!twg!bill From: bill@twg.bc.ca (Bill Irwin) Newsgroups: comp.unix.questions Subject: Re: anyone made a 'vtree' program? Keywords: find Message-ID: <490@twg.bc.ca> Date: 18 Jan 91 07:12:28 GMT References: <33@tdw205.ed.ray.com> <8961@uwm.edu> Distribution: usa Organization: The Westrheim Group, Vancouver, B.C., Canada Lines: 84 datta@vacs.uwp.wisc.edu (David Datta) writes: >Has anyone made a program or script for UNIX that does a "visual tree" >similar to the MSDOS program 'vtree' and the MSDOS V4.X tree programs? Here is a version I picked up off the net a while back, with a sample of the output. --------cut here-------------- : # Script to print a visual directory tree Dir=${1-"`pwd`"} cd $Dir echo "Vtree of: $Dir" find $Dir -type d -print | sort -f | sed -e "s,^${Dir},," -e "/^$/d" -e \ "s,[^/]*/\([^/]*\)$,\`-----\1," -e "s,[^/]*/, | ,g" --------cut here-------------- Sample output: $ cd to/some/directory $ vtree Vtree of: /u/sag/source `-----awf `-----Backup `-----bbx `-----call `-----chat `-----cobol-altos386 `-----du-new `-----filter `-----graphic `-----ichk `-----mailcheck `-----news | `-----compress | `-----cvt | `-----doc | `-----info | `-----man | `-----misc | | `-----keepnews | | `-----savenews | `-----newsxd | `-----nn | | `-----conf | | `-----contrib | | `-----doc | | `-----help | | `-----inews | | `-----man | `-----patch | | `-----patches | | `-----UU | `-----src | `-----uucp `-----othello | `-----images `-----shar | `-----backup `-----sps `-----uucp | `-----nuztools | `-----old2new | `-----rnget | `-----uplot | `-----userfile | `-----uu | `-----uucpanz `-----uugetty | `-----man `-----uutizo `-----watch `-----xmascard `-----xpd | `-----3.4b `-----zmodem -- Bill Irwin - The Westrheim Group - Vancouver, BC, Canada ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uunet!van-bc!twg!bill (604) 431-9600 (voice) | UNIX Systems bill@twg.bc.ca (604) 430-4329 (fax) | Integration