LinuxQuestions.org
Help answer threads with 0 replies.
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, 03:43 PM   #31
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925

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 03:45 PM.
 
Old 02-26-2016, 04: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, 04:23 PM   #33
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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, 11:59 AM   #34
JenGarcia33
LQ Newbie
 
Registered: Mar 2016
Posts: 12

Rep: Reputation: Disabled
Can you please help me?
 
Old 03-01-2016, 12:03 PM   #35
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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 06:30 PM
how to check browser log files on centos 5.3 mohanj.linux Linux - Newbie 3 03-27-2013 02:15 AM
Squid statistics via browser - connection aborted noigan *BSD 3 12-29-2010 09:07 AM
Apache Browser Log Files soulestream Linux - Software 1 12-14-2005 02:59 AM
Are there any browser statistics for LQ? MartinN LQ Suggestions & Feedback 3 09-21-2004 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:48 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
Open Source Consulting | Domain Registration