-   Linux - Newbie (
-   -   Find question (

facets 03-04-2005 05:24 AM

Find question

I need to find the last directory in a bunch of directories but can't work out how to do it. There is no exact structure so here's a rough example.


So with the example, i would like /home/dir2/music/jazz int he list but not /home/dir2/music same goes for /home/dir3/apps/linux/cad not /home/dir3/apps/linux.

I've tried -maxdepth and -mindepth but to no avail.

Any help would be rad.

cheers, William

nutthick 03-04-2005 06:54 AM

Sounds like you need some sort or recursive script to dig into the directories. What would be the last directory for


cad, graphcs or both?

facets 03-04-2005 06:57 AM

thanks for the reply.

the -prune flag helped here..

find -mindepth 4 -prune -type d

cheers! mark.


./Stuff/Music/[313 Crewz]/dj3000 - red line ep
./Stuff/Music/[313 Crewz]/Midnight Sound
./Stuff/Music/[313 Crewz]/[LH 004] Los Hermanos - Influence
./Stuff/Music/[313 Crewz]/inner elements[rs 94 038 cd]
./Stuff/Music/German Crewz/rs-06
./Stuff/Music/German Crewz/burnt friedman & jaki liebezeit - secret rhythms
./Stuff/Music/German Crewz/[GIGOLO 99] Dopplereffekt - Linear accelerator

nutthick 03-04-2005 07:04 AM

When you do that on


doesn't that bring up


also would that work for


Just a thought. If you've solved it great ;)

All times are GMT -5. The time now is 02:32 PM.