[mythtv-users] Added a second Tuner

James Fidell james at cloud9.co.uk
Mon Feb 28 20:23:04 UTC 2005


Quoting Shawn Asmussen (shawn.asmussen at gmail.com):
> On Mon, 28 Feb 2005 15:40:16 +1100, Phill Edwards
> <philledwards at gmail.com> wrote:
> > You could search every file on your system for "mythfrontend" to find
> > the culprits:
> > 
> > # find / -name "*" -exec grep mythfrontend {} \;
> > 
> 
> That would mostly work, although it could take forever and a day to
> finish. However, I wanted to point out a couple of things about your
> find command. First, you don't have to specify the -name option if
> you're going to use a filter of "*". The second thing, is that since
> this command will issue a new grep for each file, that means that each
> grep is on a single file, which means that grep will not print out the
> filenames for the lines it spits out. That could make it difficult to
> see what files matched. One trick you can use to get around this is to
> add /dev/null to the arguments to grep, so that technically each grep
> is on TWO files, so that grep will then print out the filenames. In
> other words, this would probably work better:
> 
> find / -exec grep mythfrontend /dev/null {} \;

Even then you can go a step further and do something like:

  find / -print | xargs grep -H mythfrontend

or, if you're likely to have filenames containing spaces, even:

  find / -print0 | xargs -0 grep -H mythfrontend

The advantage of doing it this way is probably moot these days, but in
the dim and distant past when processors were steam-powered, it meant
considerably fewer fork/exec calls and made a significant improvement
in performance.

You might also want to add a "-type f" to the find command, given that
there'll not be much point attempting to run grep on directories and
other "special" files.

James


More information about the mythtv-users mailing list