Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a big log file in linux (aprox 700MB), and i want to extract from that log all the characters that contains eg: http://mywebsite/link1/2.html
How do i do that ?
It takes too much time to search with vi with /string because I have alot of access logs on my http://mywebsite/link1/2.html with alot of IP's and I want to extract all the IP's that accessed this link: http://mywebsite/link1/2.html
otherwise you can just use
cat logfile | grep "http://mywebsite/link1/2.html"
Ok, ok... this is good. But I want to filter more, I want to extract the "http://mywebsite/link1/2.html" from [20/Apr/2009:08:22:31 +0300] to [20/Apr/2009:22:00:00 +0300]
From 08:22:31 to 22:00.
I have too many logs in the same date, in the same hour, in the same minute. I cannot copy them all because the scroll bar of the putty is too "large" and I cannot copy the whole log. Any hints ?
This is so annoying, there are too many logs, I can't even grep per minute because there are WAY TOO MANY !
Even if i do: cat access_log.2 | grep "http://mysite" | grep "20/Apr/2009:09:1" in order to have all the logs in the 2009 hour 09 and minute 1x it dosen't show me the whole logs because there are too many, and i need too export them all.
And please don't tell me to do cat access_log.2 | grep "http://mysite" | grep "20/Apr/2009:09:11" and then ...2009:09:12 and then 2009:09:13 'cause I'm gonna go crazy. I need to export the logs from hour 9:00 to hour 22:00, so please.
No this is not the way you do it use a regular expression in grep and should show you the list ebcause [0-9] for seconds and minutes, also look at things like sed and you select sections out of log.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.