difficult-to-phrase question...

Polytropon freebsd at edvax.de
Thu Sep 3 00:06:00 UTC 2009


On Wed, 2 Sep 2009 16:43:30 -0700, Gary Kline <kline at thought.org> wrote:
> 	i'm looking for a file what contains string "S".  the filename
> 	in this case has a zillion letters, but that beside the point.
> 
> 	i can use grep to find "S" and grep gives me the file[s] that
> 	have the string.  now, is there any easy way of reading that
> 	file, or deleting or otherwise munging that file?

I would suggest one of my favourite tools, the Midnight Commander,
available via ports as misc/mc or misc/mc-lite - or from a
package.

First you run the find dialog, Meta-? (Esc, ?, if you don't have
a Meta key). Enter file mask if needed, starting directory (usu-
ally .) and "S" for the search string. Then a list with the items
found will come up.

In order to view a file from this list, press PF3 on a file. The
viewer will automatically skip to where "S" has been found in the
file. If you press ENTER on the file, it will be selected in one
of the panels, and you can move or delete it.



> 	ps: if scripting this is too grizzly i'll do it in C and do an
> 	inline post of src and example use.

If you exactly know what to do with the file, scripting might be
the easiest solution. The more interaction, the less optimum it
is. :-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list