LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2004, 07:10 AM   #1
orange400
Member
 
Registered: Mar 2003
Location: Bellevue, WA
Distribution: Arch w/ XFCE
Posts: 834

Rep: Reputation: 30
find files in text-only?


How would I find a file on a text-only RH9 system?
 
Old 05-27-2004, 07:16 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Oddly enough, with the find command. The find command has a LOT of options, and it's well worth reading through its man page to skinny the skinny on everything. But assuming you know the name of the file you want to locate you can do 'find <dir> -name <filename> -print' where <dir> is the directory you want the search to start in. It will search that directory recursively and print out all files matching the name.

You can also use the locate command, which is faster since it has a cached database of file locations, but if your file was created since the last database update (usually happens out of root once a day) you won't be able to find it. You can update the database by becoming root and typing the 'updatedb' command at the prompt.
 
Old 05-27-2004, 08:50 AM   #3
lepricaun
LQ Newbie
 
Registered: Apr 2004
Location: @ home
Distribution: Red Hat 9.0, slackware 9.1, FC2
Posts: 25

Rep: Reputation: 15
find / -name filename

where / is the directory and filename is ... the filename
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find files containing specific text? SurfTurtle Linux - Newbie 7 01-05-2008 06:57 AM
How to find a work within a folder full of text files? juanb Linux - General 4 05-03-2005 05:09 PM
linux 'find' to find text files subu_s Programming 2 12-02-2004 03:56 AM
Find string pattern in directory of text files magnum818 Linux - Newbie 2 10-15-2003 09:19 PM
How to find text in a set of files? concoran Linux - General 2 06-01-2003 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:42 PM.

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