Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-21-2004, 08:45 AM   #1
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
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
find -name '*.txt'
Old 11-21-2004, 02:33 PM   #3
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.


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 > Forums > Linux Forums > Linux - Newbie

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

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