LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 07: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, 08: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, 01: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 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