kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Find text within files

Posted on May 1, 2008

Stuck trying to find text within files on Linux?

cd /directory_tree_you_want_to_search
find . -type f -exec grep -l "string to find" {} ; -print

Easy!


Related posts

  1. Fixing cPanel File Permissions
    Sometimes users mess with their own file permissions that they no longer work. They will...
  2. Using SCP to copy files between Linux servers
    SCP? SCP is a method of securely transferring files between a local and a remote...
  3. Truncate a string to the nearest word
    Truncating a string in PHP is easy, substr($start,$finish), but its annoying when it truncates the...
  4. Yellow text?
    I stumbled over a strange bug on two systems the other day where the imagettftext()...
  5. FuzzyOCR for SpamAssassin on Ubuntu
    FuzzyOCR is a plugin for SpamAssassin that analyzes the content and properties of images to...

Tagged as: Leave a comment
Comments (2) Trackbacks (0)
  1. grep -lir ‘some text’ *

  2. Almost as good, but I found it freaked out with symbolic links occasionally.


Leave a comment

(required)

No trackbacks yet.