Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: find directories that do NOT contain a certain file extension  (Read 37274 times)

0 Members and 1 Guest are viewing this topic.

hodnov

  • Guest
for x in `find /vmfs/volumes/v01tstn01a01/ -type d`; do find $x -name '*.vmx' > /dev/null || echo $x; done;

The goal of this is to find the subdirectories that do NOT contain a file with the extension of .vmx


Any help would be great!

ghostdog74



    Specialist

    Thanked: 27
    Re: find directories that do NOT contain a certain file extension
    « Reply #1 on: April 05, 2010, 06:46:33 PM »
    Code: [Select]
    find . -type d |while read DIR
    do
         ls -A $DIR/*.vmx >/dev/null 2>&1 || echo "no vmx file: $DIR"
    done