directories are like t/t1/t2/t3 and each directory has file t4.
my question is , i want to find file t4 inside directory t3 without looking in to the other sub directories.on for
Hi,
It might seem like hijacking a thread but my question is almost similar so I'm posting it here.
So, taking the tree below
.
./t1
./t1/t2
./t1/t2/t4 ------------------- (1)
./t1/t2/t3
./t1/t2/t3/t4 ------------------- (2)
./t1/t3
./t1/t3/t5/t4 ------------------- (3)
./t1/t3/t5/t6/t4 ------------------- (4)
Similar case, I need to know the directory where t4 files are stored but once t4 is located in a branch { as in (1) } the code should stop descending and should search the next branch for t4 { as shown in (3)}, and again once located should abort searching/descending that branch. Is it possible using 'find'.
Note: In my case the file is an empty file and currently I'm using "find . -name t4 -maxdepth 10 -mindepth 1 -type f -empty -size 0b". The min and max depth are a gamble so I want a solution even when depth is not known. I'm on Linux.