find a key words in a file
Hi,
I have a huge file and I am only interest in loooking for the error that translate to the key words, below is my example within the file: [28/Aug/2007:16:00:11 00] "GET /pls/orasso/orasso.wwsso_app_admin.ls_login?Site2pstoreToken=8F5F4DE8~DF7915230F9792769C4324C9D53422 AAA 100 as you can see, at the end of the error, there are AAA and 100, AAA are the keys words that I am looking for. Basically, I want to get the whole error string that had AAA and write all of those errors to a file. Can someone help? thanks |
Use grep? grep pattern file > out file, e.g. grep "AAA 100" input > output.
|
You want grep, sed and awk; mostly grep as Nylex pointed out. See the
grep man page, and then get Classic Shell Scripting from O'Reilly, it goes into a lot of detail about how to handle these things. Joel |
You can also consult the Rute book (check google) to get you started. You'll still need another book if you need more in-depth coverage.
|
All times are GMT -5. The time now is 12:20 AM. |