FW: Directory Tree

From: Danielle Georgette <Danielle.Georgette_at_asx.com.au>
Date: Fri, 28 Apr 2000 10:53:22 +1000

Morning all,

The following script gives a neat directory tree structure listing.
It was posted on the AIX managers list, but its so handy I thought
people here might get good use from it as well. Its a shell script so it
works equally well on Tru64 - i've used it a few times already.

So all thanks Daniel Clark, and I hope you don't mind the cross-post Dan!

Danielle

+-----------------------------------+---------------------------------+
| Danielle Georgette | Two major products came out of |
| Unix Admin | Berkeley: LSD and UNIX. I don't |
| danielle.georgette_at_asx.com.au | believe this to be coincidence. |
+-----------------------------------+---------------------------------+
| All opinions are my own unless clearly stated otherwise. |
+---------------------------------------------------------------------+


-----Original Message-----
From: Robert Miller [mailto:Rmille1_at_SMUD.ORG]
Sent: Friday, April 28, 2000 1:54 AM
To: AIX-L_at_PUCC.PRINCETON.EDU
Subject: Re: Directory Tree


Example: Linux.

'nuff said. ;)

--rm

> -----Original Message-----
> From: Clark, Daniel B. (ITSC) [SMTP:daniel.clark_at_MAIL.IHS.GOV]
> Sent: Thursday, April 27, 2000 8:47 AM
> To: AIX-L_at_PUCC.PRINCETON.EDU
> Subject: Re: Directory Tree
>
> To be honest, this is what I was hoping would be done. The best tools are
> the ones that start with an idea then improved upon.
>
> thanks,
>
> Dan Clark
>
> -----Original Message-----
> From: Bruce Harvey [mailto:BruceH_at_ROUTESCAPE.COM]
> Sent: Thursday, April 27, 2000 9:32 AM
> To: AIX-L_at_pucc.Princeton.EDU
> Subject: Re: Directory Tree
>
>
> As must be usual among UNIXers, I loved it so much I added to it.
>
> a '-d' option to specify ONLY directories, and an optional argument
> to do another directory than the one you're in.
>
> Hope you don't mind, Dan!
>
> -----------------------------------------------------------------------
> Bruce T. Harvey ... Special Projects Developer ..... 410.403.2390 (vox)
> www.routescape.com ... b.t.harvey_at_bigfoot.com ...... 410.329.1114 (fax)
> http://surfree.homestead.com/btgmharvey/ ...... b.t.harvey_at_computer.org
> -----------------------------------------------------------------------
> Insight Distribution Systems-222 Schilling Circle-Hunt Valley, MD 21031
>
> -----------------------------------------------------------------------
>
> #!/bin/ksh
> #
> # dir_tree
> # Display from current Directory Tree.
> #
> homedir=`pwd`
> dodir=""
> dowhat="Files and Directories"
> set -- `getopt d $*`
> if [ "$?" != "0" ]
> then
> exit 1
> fi
>
> while [ "$1" != "--" ]
> do
> case $1 in
> -d) dodir="-type d " export dodir
> dowhat="Directories only" export dowhat
> ;;
> esac
> shift
> done
> shift
>
> if [ "$1" != "" ]
> then
> cd $1
> fi
>
> { echo "$dowhat ... Directory: `pwd`"
> find . $dodir -print | sed '
> s:^'$base':|:
> s:/\([^/]*\)$:?? \1:
> s:/[^ ?/]*: |:g
> s:?:_:g
> '
> }
>
> cd $homedir
>
>
> -----------------------------------------------------------------------
>
>
> -----Original Message-----
> From: Clark, Daniel B. (ITSC) [mailto:daniel.clark_at_MAIL.IHS.GOV]
> Sent: Thursday, April 27, 2000 10:53 AM
> To: AIX-L_at_pucc.Princeton.EDU
> Subject: Directory Tree
>
>
> A couple of months ago, someone on the list had asked about a directory
> tree
> for AIX. ...
>
> ----------------------------------------------------------------------
>
> Dan Clark
> Senior System Development Consultant
> Rose International,
> Indian Health Service
> Albuquerque
Received on Fri Apr 28 2000 - 00:55:07 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT