dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

determine the greatest depth of subdirectories in a hierarchy - shell

This is a discussion on determine the greatest depth of subdirectories in a hierarchy - shell ; On Oct 31, 1:47*am, Laurianne Gardeux wrote: > Le Thu, 30 Oct 2008 16:35:29 -0700, luxor1275bc a écrit*: > > > > > On Oct 30, 3:02*pm, Janis Papanagnou > > wrote: > >> Laurianne Gardeux wrote: > >> > ...


Home > Database Forum > Operating Systems > shell > determine the greatest depth of subdirectories in a hierarchy

Reply

 

LinkBack Thread Tools Display Modes
  #11  
Old 10-31-2008, 09:35 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: determine the greatest depth of subdirectories in a hierarchy

On Oct 31, 1:47*am, Laurianne Gardeux wrote:
> Le Thu, 30 Oct 2008 16:35:29 -0700, luxor1275bc a écrit*:
>
>
>
> > On Oct 30, 3:02*pm, Janis Papanagnou
> > wrote:
> >> Laurianne Gardeux wrote:
> >> > Le Thu, 30 Oct 2008 13:57:25 -0700, luxor1275bc a écrit :

>
> >> >>If do a 'find . -type d',
> >> >>how can I determine the greatest depth of all the subdirectories in
> >> >>that hierarchy?

Another solution (I don't know how portable is it):
find . -type d -printf "%d\n" | sort -n | tail -1


Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 12:04 PM.