LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2008, 09:03 PM   #1
Snouser
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Rep: Reputation: 15
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?
 
Old 08-01-2008, 09:20 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Use the -maxdepth option.
Code:
find -maxdepth 1 -name '*.zip'
 
Old 08-01-2008, 09:45 PM   #3
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41
For the current directory why not just use

ls -d *.zip

Last edited by lwasserm; 08-01-2008 at 09:47 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using find and rm command to delete files over x days old 200mg Linux - Newbie 16 09-03-2008 06:41 PM
How to find files and copy the found files to the floppy in one command justmehere Linux - Newbie 11 05-04-2008 11:29 PM
Puppy Linux finds wrong mouse w_r_cromwell Linux - Hardware 0 03-27-2007 09:57 AM
what command can i use to find files of a certain size? abutzki Linux - Newbie 2 01-31-2006 07:43 AM
find and replace in files from command line dexter_modem Linux - General 4 06-10-2003 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration