LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   find -name command finds the wrong files (https://www.linuxquestions.org/questions/linux-software-2/find-name-command-finds-the-wrong-files-659857/)

Snouser 08-01-2008 09:03 PM

find -name command finds the wrong files
 
Hi

When I'm running this command.

find -name '*.zip'
I want to found zip files in the current directory, but for some reasons 'find' searches in subdirectory.

How do I make it to search in just the current directory?

weibullguy 08-01-2008 09:20 PM

Use the -maxdepth option.
Code:

find -maxdepth 1 -name '*.zip'

lwasserm 08-01-2008 09:45 PM

For the current directory why not just use

ls -d *.zip


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