Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    find & grep multiple files

    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:

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

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

  2. #2
    Linux User
    Join Date
    Jan 2007
    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
    NYC, moved from KS & MO
    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

Posting Permissions

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