LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2016, 04:43 PM   #31
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,213

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342

Quote:
Originally Posted by reginah72 View Post
yes
Ok, as you've done such a great job, we'll finish this off, but I'll explain what I'm doing so that you can understand.

In English, what do we want? - to find and count all the lines which do not have Firefox or MSIE or are a blank line

In grep, -v means "reverse the result". It is like a "do not".

Also in grep, OR is represented by \| (there are other ways of expressing OR but we'll ignore them for now).

A blank line can be expressed as ^$

So, you need to have:

Code:
grep -v "Firefox\|MSIE\|^$" example.log  | wc -l
Et voilą. Let me know if it works and what the results are.

Last edited by hydrurga; 02-26-2016 at 04:45 PM.
 
Old 02-26-2016, 05:13 PM   #32
reginah72
LQ Newbie
 
Registered: Feb 2016
Posts: 16

Original Poster
Rep: Reputation: Disabled
It gave me the number 1509. Thank you so much for helping me out. Now I'm not going to fail and you have made me want to learn more about Linux. Thank you again
 
Old 02-26-2016, 05:23 PM   #33
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,213

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Quote:
Originally Posted by reginah72 View Post
It gave me the number 1509. Thank you so much for helping me out. Now I'm not going to fail and you have made me want to learn more about Linux. Thank you again
Great result!

What I would do, if I were you, is just check that the number of Firefox lines + the number of MSIE lines + the number of non-MSIE/Firefox lines equals the entire number of non-blank lines in the logfile.

To get a count of all the non-blank lines, use

grep -c . example.log

(. means find something with at least one character)

I'm glad you want to learn more. As you can see, and we've only scratched the surface, the possibilities of what you can do are endless.

Just remember, (i) start off simple and then make things gradually more complex; (ii) think in English (or your native language) about what you are going to do before you code it; (iii) constantly test things to see that they are working like you think they should, and use man to learn more about the commands.

All the best!
 
Old 03-01-2016, 12:59 PM   #34
JenGarcia33
LQ Newbie
 
Registered: Mar 2016
Posts: 12

Rep: Reputation: Disabled
Can you please help me?
 
Old 03-01-2016, 01:03 PM   #35
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,166
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Quote:
Originally Posted by JenGarcia33 View Post
Can you please help me?
Welcome to LQ!
You can and should start your own thread at http://www.linuxquestions.org/questions/linux-newbie-8/
Please review some things we'll need when you post, eg: https://www.linuxquestions.org/quest...#faq_lqwelcome

Thank you,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with getting browser statistics reginah72 Linux - Newbie 2 02-26-2016 07:30 PM
how to check browser log files on centos 5.3 mohanj.linux Linux - Newbie 3 03-27-2013 03:15 AM
Squid statistics via browser - connection aborted noigan *BSD 3 12-29-2010 10:07 AM
Apache Browser Log Files soulestream Linux - Software 1 12-14-2005 03:59 AM
Are there any browser statistics for LQ? MartinN LQ Suggestions & Feedback 3 09-21-2004 09:34 AM


All times are GMT -5. The time now is 06:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration