LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2004, 08:45 AM   #1
b123coder
Member
 
Registered: Nov 2004
Location: india
Distribution: Fedora core 1
Posts: 67

Rep: Reputation: 15
locate error


How can i find files with specific extensions in current directory recursively?
say i want to fine all txt files in /home/mydir/ then what is command?
I tried with locate but as it relies on database created from / i got lot of entries.
and find gives me syntax error.
 
Old 11-21-2004, 09:04 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Code:
find -name '*.txt'
 
Old 11-21-2004, 02:33 PM   #3
stonecrest
Member
 
Registered: Sep 2004
Distribution: Arch :D
Posts: 66

Rep: Reputation: 15
You could also update your locate database with just those directories, do the search, and then re-populate locate with /.

For example:
#locate -U /home/mydir
#locate *.txt
#locate -u

man locate for more help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
fatal error using "locate" Jaykay3k Linux - Software 4 03-02-2005 03:00 PM
error message: /var/lib/locate/locatedb: retiqlum Debian 5 01-12-2005 02:32 AM
ALSA install error - 'Can't locate module snd-au8830 Foxy Linux - Hardware 10 07-07-2004 12:15 PM
receive error when trying to locate files. jleakey77 Linux - Newbie 2 03-07-2004 08:33 PM
Can't locate locate hindenbergbaby Linux - Newbie 3 10-22-2003 05:13 PM


All times are GMT -5. The time now is 04:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration