Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, i'm trying to make a script that finds all the files in /usr/share/app-install with 'beagle' in the filename and then i need to get the lines where an empty ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    1

    find & grep multiple files


    Hi,
    i'm trying to make a script that finds all the files in /usr/share/app-install with 'beagle' in the filename
    and then i need to get the lines where an empty space followed by a " appears

    Now i got some parts, but can't put it together:

    Code:
    find /usr/share/app/install -iname *beagle* -exec grep * \"* -H {} \;
    thanks in advance!

    --- edit
    i managed to get the following working with a friend:
    Code:
    find /usr/share/app-install -name *beagle* -exec grep ' \' {} \;
    but it doesn't work on my computer?

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    478
    welcome to the forum

    > app-install
    > app/install

    note inconsistent usage.

    I found this to work pretty good:

    cd /usr/share/app-install
    find . -name *beagle* -exec grep ' \"' -H {} \;

    note the space between "'" and "\"
    the sun is new every day (heraclitus)

  3. #3
    Linux User
    Join Date
    May 2008
    Location
    NYC, moved from KS & MO
    Posts
    251
    Why do you need command find? As you can simply do a
    cd /usr/share/app-install
    grep -r ' \"' *beagle*

    The -H option is omitted here as grep will use -H by default when you search in multiple files. The -r option enables recursive search under /usr/share/app-install.

  4. $spacer_open
    $spacer_close

Posting Permissions

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