Directory tree tools

Richard Steinberger ric at ace.sri.com
Fri Feb 2 04:22:38 AEST 1990


    I received such helpful responses to my query about command line
editing tools that I thought I would ask for suggestions about another
possible Unix tool.  At the moment the only utility I have to sketch out a
directory tree is the following:
-----------------------------------------------------------------
:	# from Unix world, 6/89, p 131
USAGE="Usage: $0 [directory]"
case $# in
	0) ;;
	1) if [ ! -d $1 ]; then
		echo "$1: not a directory" >&2
		echo $USAGE >&2
		exit 1
	   fi ;;
	*) echo $USAGE >&2
	   exit 1 ;;
esac
cd $1
cdir=`pwd`			#save current dir
find . -type d -print |		#locate all directories
sort |				#sort names, present to awk
awk -F/ 'NR == 1 { print "'`basename $cdir`'"}
	 NR >  1 {for (count = 1; count < NF; count++)
			printf "    "		#indent for each dir
			print $NF		#display file name
		}'
--------------------------------------------------------------------

    While this works well enough, i.e., it does draw a picture of a a
directory tree, what would be really nice is a tool that draws the tree,
then highlights the current directory (inverse video perhaps), and allows
the user to navigate to a new directory, rename a directory, move a
directory to a new node on the tree, or delete a directory, using arrow keys
and other keys as appropriate.  Also useful would be the ability to get a
brief listing of the files in the current directory (wherever the user has
traveled to using arrow keys) without leaving the utility.

    Does anyone know of such a utility?  Things like this exist for 
VMS (swing) and for PCs (e.g., xtree), and it would be nice to have
the same capability for unix machines.

    Thanks for any suggestions.  If there is enough interest, I could post
a summary.

regards,

	ric steinberger
	ric at ace.sri.com   or   ric at rml2.sri.com



More information about the Comp.unix.questions mailing list