log-file output in separate files

James Shanks jshanks at lrlec.org
Wed Feb 25 14:18:02 UTC 2004


> 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
>
> ...for getting output
>
> Is there a way to give these commands and then the output is
> automatically stored in a new file?
>
>
>

grep -n "expression" /var/log/logfile > filename





More information about the redhat-list mailing list