[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: log-file output in separate files



On Wednesday 25 February 2004 06:28 am, Paal Marker wrote:
> I need to store excerpts of logfiles in separate files from remote server.
>
> Usually I use the commands:
> grep -n "expression" /var/log/logfile
> and
> tail --lines=x /var/log/logfile

You mean, using redirection? 

grep -n "expression" /var/log/logfile > newfile.txt

will store the output to the newfile.txt.  The ">" sign basically redirect the 
standard output to something (usually file).

RDB


>
> ...for getting output
>
> Is there a way to give these commands and then the output is
> automatically stored in a new file?

-- 
Reuben D. Budiardja
Department of Physics and Astronomy
The University of Tennessee, Knoxville, TN
---------------------------------------------------------
"To be a nemesis, you have to actively try to destroy 
something, don't you? Really, I'm not out to destroy 
Microsoft. That will just be a completely unintentional 
side effect."
                 - Linus Torvalds -




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]