Writers' Community!
Home News Business Science & Technology Life
Front Page Page Two Columnists Submit an Article FAQs Contact Author Login
Article Submission
We Need YOUR Articles!
We'll Promote Them for FREE!

Author Login

New Authors
Register Here


Now Serving 5,560 Authors
48,455 Quality Articles
& 7,107 Current Users Online!
Featured Authors
Alf Gordon (1,365)
Nicole Beurkens (148)
Jeff Brown (7,977)
David Tanguay (7,555)
Ira Coffin (897)
Joel Hendon (4,850)
Terry Mitchell (2,785)
Rob Lafferty (123)
Arlene Wright-Correll (10,108)
Jane Bullard (1,959)
Robert Melaccio, Sr. (6,499)
Avis Ward (13,445)
Richard Nicastro (2,545)
Dianne Lehmann (3,112)

View All Featured Authors
Most Recent
7 Tiers of Data Recovery - Software Aspects

DVD Repair, Scratched DVDs and Unfinalized DVDs recovery tips and tricks.

Computer Security

5 Tips To Prevent Needing A Data Recovery

Repair Scratched DVDs, CDs and Game Discs

RAID Data Recovery

Backup Your Computer Files or Risk Losing It All

Harddrive Backup - The Best Way to Get it Done

Avoiding Disaster When Your Hard Drive Fails

Offsite Backup Services – For the Average Consumer?

Home » Categories » Computers & Networking » Data Backup / Recovery » Linux: Find files containing text » Printer Friendly

Linux: Find files containing text

Rated 3 out of 5
No Reader Ratings Available ?
Rate It  /  View Comments  /  View All Articles submitted by Selwin Verallo
Submitted Friday, August 24, 2007
Selwin Verallo (363)
http://smart-pad.blogspot.com
Log in to become a member of Selwin Verallo's Fan Club!


Because of our being forgetful in nature, we oftentimes forget the files that we have created. We can only be fortunate if we can still remember the path, folder, or directory where we have stored those missing files. If that's the case, it would never be a big deal then. However, trully this a big problem and even painful if we can't even remember where we have placed the missing files in our computer. "Simple," I'm hearing you... "find it." Yeah, we can find it. But wait, do you know the filename?

Forgetting files and forgetting the filenames are most common in us. I will never believe somebody out there have a photographic memory and has never experienced missing some of the files he had created before. For sure, we all have gone through that frightening experience especially if the file that is missing is so precious to us.

In Windows, this problem can easily be addressed just by using the find or search tool in the Start menu. Can you remember some texts or phrases in the filename? Use "find files with names" and unleash the power of the wildcard character (*). For example, if you can only remember the word "statistic" in the filename, then search for "*statistic*" and that will search for files with the word "statistic" in the filename. "I can't even remember a word in the filename," again I can hear you saying that. Well, I don't think you can't even remeber even a single word in the file content itself. If you can't remember even a word or phrase in the filename then go for the file content itself. In Windows, still you can search for files containing some texts that you specify in your "find files containing text" input box. That will absolutely solve your problem of forgetting words in the filename itself.

However, if you are in Linux, the whole thing would be more different and complex than it is in Windows especially if you are just a normal user dependent on the GUI interface. Linux is more on executing commands from a shell.

So if you are a normal user and that you are facing the "missing files" problem in Linux, don't worry, I will show you the most common methods in solving this issue:

Find files that contain a text string

grep -lir "text to find" *

The -l switch outputs only the names of files in which the text occurs (instead of each line containing the text), the -i switch ignores the case, and the -r descends into subdirectories.


Find files containing search terms on Ubuntu

To find files containing keywords, linux has a powerful command called grep, which you can use to find the lines inside any file or a list of files.

grep -i -n ‘text to search' *

List files containing text

Used to recursively search a directory for files containing a string, output the names of the files and the line number. This will search all regular files in for .

grep --with-filename --line-number `find -type f`

Find more tips and techniques at Smart Pad.





Reprint Rights

Log in to become a member of Selwin Verallo's Fan Club!

Comments on this article:
No comments yet.


Was this article helpful to you? Leave a Public Comment or Question:

 

This Article has been viewed 1,908 times.
Article added to SearchWarp.com on Friday, August 24, 2007
View other articles written by Selwin Verallo (363)


If you found this article interesting, you may want to check out:

Disclaimer:  All information on this site is provided for informational purposes only! By no means is any information presented herein intended to substitute for the advice provided to you by any health care or other professional or organization.


Today's Most Popular
What causes a Hard Disk Clicking Sounds

Linux: Find files containing text

Why RAID ? What are the advantages and disadvantages of RAID arrays Servers?

Reinstalling Windows XP Without Drive Format

Microsoft Windows XP Tips – Recover Your Hard Drive Using System Restore

Technical Support on Using Windows XP's System Restore Function

Maintenance Tips for Optimal PC Performance

Brief Tutorial That Provides An Overview of Norton Ghost 10.0

Confidentiality, Integrity, Availability and What it Means to You

Standby Generators - Regular servicing with a load bank, Why?

Home  |  Page Two  |  FAQ's  |  Contact  |  Terms of Service  |  Article Submission Guidelines  |  Writers' Contests  |  Privacy  |  Mission / About
Copyright © 1999-2008 SearchWarp.com, All Rights Reserved - SearchWarp.com is an IcoLogic, Inc. Company