saving log information to a separate file
Hi,
I want to run 'grep' to parse out thousands of log files based on an IP address, and save this output to another file so that I can export it to another server. How would I go about doing this? Is there a command i can issue to work in conjunction with grep that will save this output to a separate file? Thanks |
You can use
cat logfile|grep something >newfile or cat logfile|grep something >>newfile (>> adds at the end, >erases old file content) |
Thanks!
This also worked for me. ---------------------------------------------------------------------------------- [root@xxxx]# grep 'something' 'logfile' > newfile --------------------------------------------------------------------------------- Good to know about the difference between '>>' and '>'. |
All times are GMT -5. The time now is 08:55 AM. |