Using find command

Hi,

I have a folder containing other files and folders. I wish to list all of them except for hidden files/folders.

I tried:

find . \( ! -regex '.*/\..*' \) -"type" f
find . -tyoe f |grep -v '/\.'

These 2 works well. but if I have a empty folder, it will not list my empty folder.

Is there a way to list all files and folders(regardless empty or not), except hidden files/folders?

Thanks a lot!

Hi.

You could try the following:

find . ! -name ".*"
1 Like

Hi, I just tried. i have this .svn folder. If this folder is empty, ur method works well. However if inside this .svn folder, there is a file called "file1", then .svn/file1 appears.

How can I make it ignore all .svn folder even if the file inside is without "."?

Try this

find . ! \( -name ".?*" -prune -o -name ".*" \)

--ahamed

1 Like

This works! Thanks :slight_smile: