Operating System - Linux
1822781 Members
4018 Online
109645 Solutions
New Discussion юеВ

Re: Directory tree in HP-UX

 
SOLVED
Go to solution

Directory tree in HP-UX

Hi everybody,
do you know any UNIX hp-ux (B.11.11) command in order to get the Directory tree, like TREE command in CMD (Windows)?
Christian Aguilar
6 REPLIES 6
Bill Hassell
Honored Contributor

Re: Directory tree in HP-UX

It's not pretty but you can use the -R option to ls or ll.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: Directory tree in HP-UX

There is a utility called pstree which is available from the HP-UX Porting and Archive Centre that will produce a postscript file describing a current directory and its tree. Yon can then send that output to a postscript printer or a postscript viewer.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Directory tree in HP-UX

Another rather easy approach would be to use Perl's File::Find module. It should be rather easy to keep up with the level of recurion and indent appropriately.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Directory tree in HP-UX

Hi:

Yet another Perl approach could be to create a subroutine that calls 'readdir()' to read a directory. As subordinate directories are encountered, recursively call the subroutine, each time increasing the tree's indentation. TMTOWTDI.

Regards!

...JRF...
Arturo Galbiati
Esteemed Contributor
Solution

Re: Directory tree in HP-UX

HI,
you can use the attached script. No additional SW is required.
HTH,
Art
James R. Ferguson
Acclaimed Contributor

Re: Directory tree in HP-UX

Hi (again):

If you have found a solution, please assign points and close this thread. Thanks!

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Regards!

...JRF...