Operating System - HP-UX
1838509 Members
2673 Online
110126 Solutions
New Discussion

Could I do a "tree" in hp-ux???

 
SOLVED
Go to solution
Carme Torca
Super Advisor

Could I do a "tree" in hp-ux???

Hi,

Could I list all the directories and files of one recursive in one directory???

Thanks!!,
Carmen.
Users are not too bad ;-)
7 REPLIES 7
RAC_1
Honored Contributor
Solution

Re: Could I do a "tree" in hp-ux???

man ls

ll -R

Anil
There is no substitute to HARDWORK
Steven E. Protter
Exalted Contributor

Re: Could I do a "tree" in hp-ux???

ls -R will give you a recursive look at all files


cd /etc

ls -R

you can add other parameters such as l or a to get more ouptut.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
H.Merijn Brand (procura
Honored Contributor

Re: Could I do a "tree" in hp-ux???

# ls -R

# perl -MFile::Find -le'find(sub{print$File::Find::name},@ARGV)' .

# find .

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: Could I do a "tree" in hp-ux???

Even better :)

# perl -MTk -MTk::DirTree -e'MainWindow->new->DirTree->pack;MainLoop'

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: Could I do a "tree" in hp-ux???

Even better :)

# perl -MTk -MTk::DirTree -e'MainWindow->new->DirTree->pack;MainLoop'

or more usable

# perl -MTk -MTk::DirTree -e'MainWindow->new->Scrolled("DirTree")->pack(qw(-exopand 1 -fill both));MainLoop'

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Victor BERRIDGE
Honored Contributor

Re: Could I do a "tree" in hp-ux???

Just for the fun in shell:
call it tree or like me dtree...

#
# dtree : print a hierarchy tree starting at spcified directory
# (.default)

(cd ${1-.};pwd);
find ${1-.} -type d -print | sort -f | sed -e "s,^${1-.},," \
-e "/^$/d" -e "s,[^/]*/\([^/]*\)$,\`-------\1," -e "s,[^/]*/,| ,g"
#

As you will have noticed no argument means current directory

All the best
Victor
Carme Torca
Super Advisor

Re: Could I do a "tree" in hp-ux???

Thanks Victor, it's really good!!!
Users are not too bad ;-)