Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
find a string
Results 1 to 3 of 3

Thread: find a string

  1. #1

    find a string

    Hi all,

    How do i find a file which has a particular string? I have to find the string scanning entire system.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  2. #2
    Newbie
    Join Date
    May 2007
    Location
    Silicon Valley
    Posts
    5

    Cool man grep

    grep "string I'm looking for" file

    in windows find can be used but its a pain, better to download a port of grep.
    -C

  3. #3
    $ man grep
    $ man find

    # find / -type f -print0 | xargs -0 grep -I -H "string to find"

    will give you all the strings and where they were found.
    This searches the entire file system starting from the root, but skips binary files..
    If you want to search only part of the file system, replace the first argument to find (/) with the directory from which to start.

    # find / -type f -print0 | xargs -0 grep -I -l "string to find"

    will give you only where the strings were found.

    Note: those arguments to grep are
    -I (capital eye) meaning "Ignore binary files"
    -l (lower-case ell) meaning "list files where strings were found"

Similar Threads

  1. string enter to text file in PHP
    By lasanthaindika in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 05-22-2008, 02:53 AM
  2. Using Grep and regex to pull a value out of a string
    By thestonefox in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 10-24-2007, 03:58 PM
  3. Converting from an int to a string in C?
    By norfolknchance in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 03-19-2003, 11:05 PM
  4. c string array question
    By t048 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 07-12-2002, 03:02 PM
  5. String of text into file?
    By MZGuy in forum Linux - General Topics
    Replies: 8
    Last Post: 01-03-2002, 09:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •