Re: puTTy help



"fnibogey" <finbogey@xxxxxxxx> writes:

Todd H. wrote:
"fnibogey" <finbogey@xxxxxxxx> writes:

Please help a total noob. I'm using puTty to access a linux server. I
grep strings from compressed directories. I would then like to be able
to search those results on my puTTy screen. Is this possible?

Yes, but it's neither an ssh or putty question really. It's more of a
unix shell question. But try this:

$ strings bigdirectoryiwannagrep/* | grep myfavoritegrepstring |
less
[snip]

Thanks Todd, I'll try these.

So I take it there is no way to actually search these results of a grep
short of outputting it to a text file and searching that?

I think the concept you may be missing is what a the pipe (|)
character does. It obviates the need to put output into a disk file
and handles things "on the fly" if you will.

The command above looks for strings in all files in
bigdirctoryiwannagrp, pipes the standard output (stdout) to the grep
function which searches among those string for lines that match
myfavoritegrepstring, and then pipes that to a program that allows you
to page through the output (which is very handy if you get more than a
screen full of output).

The guy next to me uses a Mac and his terminal program lets him search
the screen. It would save a few steps.

Interest--didn't know it had that feature. That would be a client
side way of doing it, but what if the terminal program has a
scrollback buffer set to something smaller than the output you've
created? You may miss something. That's why it's better to handle
the output yourself, in my opinion.

However, there's another command line program that'll do what you
want.

$ screen

It can search it's history, but I've never had occasion to do that.

Not the answer you wanted, but some ideas anyway.

Best Regards,
--
Todd H.
http://www.toddh.net/
.



Relevant Pages

  • Re: while (1) vs. for ( ;; )
    ... > To bad grep doesn't know how to ignore C comments and literals. ... or is this just a silly objection for the ... Use an editor and fix the problem. ... In cases where 'while' appears inside strings (or ...
    (comp.lang.c)
  • Re: find lines containing identical strings in two files
    ... that are also present as identical AA1234 strings in a saved file. ... created with the 'find' command, contains 'AA1234', and if the ... Any idea what combination of the standard Unix utilities (grep, sed, ... Or take my ealier awk solution; without a temp file and much faster. ...
    (comp.unix.questions)
  • Re: Grep through a log file
    ... but the strings in $culist don't appear unmodified in the log ... chomp $culist; ... Next, grep(). ... I tried your script. ...
    (perl.beginners)
  • Re: find lines containing identical strings in two files
    ... that are also present as identical AA1234 strings in a saved file. ... Any idea what combination of the standard Unix utilities (grep, sed, ... Michael Tosch @ hp: ... you must use a tempfile: ...
    (comp.unix.questions)
  • locate and grep command
    ... Does anyone have a way to run locate with grep. ... I frequently want to find strings in files that I find in the locate ... command. ... There must be a loop or something that could be written but I dont ...
    (comp.unix.shell)