Re: printing the associated filenames found by 'strings'

From: Chuck Dillon (spam_at_nimblegen.com)
Date: 03/30/05

  • Next message: Rich Gibbs: "Re: Search for Large files in Unix"
    Date: Wed, 30 Mar 2005 09:55:44 -0600
    
    

    subPlanck@excite.com wrote:
    > I'm trying to find a certain text string in a large number of binary
    > files. The 'strings' utility finds the files, the offset and the string
    > I'm searching for, but it doesn't print the associated filenames, like
    > grep does. How do I modify the expression below to show them?
    >
    > find / -name "*.dll" -exec string -a -x {} ; | grep 'foo bar'
    >
    > z.entropic
    >

    Something along the lines of...

    find ~ -name "*.dll" | xargs -i# echo "strings -a -tx '#' | \
    grep whatever | sed 's,^,#,'" | sh

    -- ced

    -- 
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.
    

  • Next message: Rich Gibbs: "Re: Search for Large files in Unix"

    Relevant Pages

    • Re: List files containing a string..
      ... Er, the question was about files containing a string, not about file ... got were responses like man grep, ... What is not readily apparent in the xargs man page is that it ... that is the standard one on FreeBSD has a -r/-R option and even ...
      (comp.unix.bsd.freebsd.misc)
    • Looking for text inside files does not work at all
      ... for an ascii text string in a file. ... Hex-editing the file reveals that there is a string called "reloc" right ... So if text search (aka grep) worked, this should work too shouldn't it? ... That's how it worked in Windows 2000. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: modifying files using script
      ... specific string with another one. ... This script works well for one file but exits after that. ... so I used fgrep in the example (grep -F may be preferable or required ... as string by fgrep and RE by $editor, ...
      (comp.unix.shell)
    • Looking for ascii text inside files doesnt work at all
      ... for an ascii text string in a file. ... Hex-editing the file reveals that there is a string called "reloc" right at the beginning of the file. ... So if text search (aka grep) worked, this should work too shouldn't it? ... I change the term in the _middle_ input field to 'i.cpl'. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: grep a string
      ... > I am trying a find all occurences of a SUBSTR in string ... > will -b option for grep be useful. ... SUBSTR or not. ... > perl script to find all occurences of SUBSTR.. ...
      (comp.unix.shell)