find all directories EXCEPT hidden (.example/) - Unix

This is a discussion on find all directories EXCEPT hidden (.example/) - Unix ; I'm using the following command to find all directories located in $HOME/$yourNewPrj/lvs/, but I would like to exclude all hidden directories (starting with "."). Is there a flag I could set with the FIND command. subDirs=`find $HOME/$yourNewPrj/lvs/ -type d -mindepth ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: find all directories EXCEPT hidden (.example/)

  1. find all directories EXCEPT hidden (.example/)

    I'm using the following command to find all directories located in
    $HOME/$yourNewPrj/lvs/, but I would like to exclude all hidden
    directories (starting with "."). Is there a flag I could set with the
    FIND command.

    subDirs=`find $HOME/$yourNewPrj/lvs/ -type d -mindepth 1 -maxdepth 1`
    #finds all subdirs in /lvs dir


  2. Re: find all directories EXCEPT hidden (.example/)

    * vtcad [2007.04.19 16:21]:
    > I'm using the following command to find all directories located in
    > $HOME/$yourNewPrj/lvs/, but I would like to exclude all hidden
    > directories (starting with "."). Is there a flag I could set with the
    > FIND command.


    find $HOME/$yourNewPrj/lvs -mindepth 1 -maxdepth 1 -type d ! -name ".*"

    Note that -mindepth and -maxdepth are GNU extensions not
    available on all plateforms.

    More portably:

    find $HOME/$yourNewPrj/lvs ! -name . -prune -type d ! -name ".*"

    --
    JR

+ Reply to Thread