![]() ![]() should return all Lines from File1 where ('Hi (Every') doesnt contains. the Grep-Flag -v inverts the Grep-Command. Grep -o '^\|****' final_result_ip > bookmarked_ip But, It is matching the pattern irrespective of the position, Example: if file1: HelloHi (Everyone) file2: Hi (Every, grep -Fvf is removing that, any idea to grep it from beginning of a line alone. Sdiff -s combined_log_sort_ip search_sort_ip > final_result_ip Grep -o '****' combined_log_sort > combined_log_sort_ip Grep -o '****' search_sort > search_sort_ip ![]() Sort -un combined_log > combined_log_sort #now sort them to eliminate duplicates and put them in order combined_log is the original fileĮgrep '(google)|(yahoo)|(mamma)|(query)|(msn)|(ask.com)|(search)|(altavista)|(images.google)|(xb1)|(cmd.exe)|(trexmod)|(robots.txt)|()|(POST)' combined_log > search If you take the plunge without a bit of insider know-how, you could well be left scratching your head at the results. However, like many Linux commands, it has a few quirkswhich is fine, as long as you know about them. #eliminate search engine referals and zombie hunters. 01:13 Finding Matching Lines of Text on Linux The uniq command is fast, flexible, and great at what it does. Another similar script that I wrote for a Slackware system is here: You may need to go through and update browser version numbers. Those expressions work to extract the ip address numbers. The key to this is in the lines used with grep. Use Gvim or Vim to read the resulting file, which will be called unique_visits, which will list the unique ips in a column. It greps out addresses from apache access logs. The following is a script I wrote several years ago. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |