General :: Use Grep Command To Filter The Log Files Created Between 3:00 PM To 4:30 PM In Buch?

Dec 13, 2010

I would like to know how to use grep command to filter the log files created between 3:00 PM to 4:30 PM in buch of log for whole day in different headings. This files resembles like sar file in linux.

View 5 Replies


ADVERTISEMENT

General :: Filter Out Unique Results From Grep Output?

Feb 21, 2010

In linux, I can grep a string from a file using grep mySearchString myFile.txt.
How can I only get the result which are unique?

View 1 Replies View Related

General :: Grep Command - Show The Files But Not The Line Count

Oct 31, 2010

This has to also show the line count. I can get it to show the files but not the line count. What is the single command used to identify only the matching count of all lines within files under the /etc directory that contain the word „HOST? List only the files with matches and suppress any error messages.

View 4 Replies View Related

Programming :: Bash: Using Grep To Filter 25 Or Above?

Dec 3, 2010

i have a sample that looks like this:

Code:
[schneidz@hyper temp]$ wget -q --output-document=- http://world.needforspeed.com/SpeedAPI/ws/game/nfs-w/leaderboards/events

[code]....

View 2 Replies View Related

General :: Find/grep/wc Command To Find Matching Files - Print Filename And Word Count?

Sep 11, 2009

I am trying to do a find/grep/wc command to find matching files, print the filename and then the word count of a specific pattern per file. Here is my best (non-working) attempt so far:

wc `find . ( -name "*.as" -o -name "*.mxml" ) -exec grep -H HeightResizableList {}` ;

View 10 Replies View Related

Ubuntu :: Search Files Containing A String / Grep Command?

Sep 1, 2011

how to search for those files which contain word "AM_COLLECTION=22". I need to know all the files with this string. ( I know the grep command can do it but either

View 4 Replies View Related

Ubuntu :: Filter Date By Range Of Month Using Grep?

Jan 30, 2011

how to filter Date in terminal? I can filter a month from another month using grep but I cant grep multiple months. example, I want to show the data from 20/Jan/2011 to 10/Sep/2011. Grep can only show data of January and September. Is there any other unix commands I can use to achieve what I want?

View 9 Replies View Related

Programming : Find Out Files That Are Changed Less Than 10 Hours With Grep Command?

Mar 20, 2010

Getting the list of files in the root directory that have changed less than 10 hours earlier, using grep, but without the directories.

View 1 Replies View Related

Ubuntu :: Filter Specific Text From Source Code With Grep?

Feb 27, 2011

I'm working on a new conky script, and I had the idea to use text from a [URL]... The command I'm using to pull the file is:

Code:
curl -s http://www.thefuckingweather.com/?zipcode=33186 | grep 'ITS FKING *'
However, this gives me the entire line of code this line appears in.
Code:
<br />ITS FKCING NICE</div><div id="remark"><br />
How can I limit this to simply the text?

Sorry about the foul language btw...the words obviously aren't misspelled when I enter them in the terminal

View 5 Replies View Related

Ubuntu :: Command To Copy Files In Directory Created Within 2 Hours?

Apr 22, 2010

Is there a simple command to copy files that have been created within the past 2 hours?I've been looking through the man pages for unisonrsyncfindcpand I can't find anything I'm looking for.All I need is a simple command.Code:Copy folder a to b if created < 2 hours.

View 4 Replies View Related

General :: How To Add Such Filter To Rsync Command Line

Oct 27, 2010

I'm trying to understand rsync filters .. but it isn't goig to well.I want to rsync only files with a specific extension (.gz.des3). Could someone please tell me how to add such filter to the rsync commandline (not a seperate filter filer).

View 2 Replies View Related

General :: Break Down A Grep Command?

Apr 8, 2011

What does this command mean? grep 'GET / HTTP.*Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1' last10m |cut -d ' ' -f1 |sort -n |uniq -c|sort -n|tail

Whats the best way to figure out these commands in general? I have a lot of learning to do!

View 9 Replies View Related

General :: Filter Script Files In Bash Programming?

Feb 10, 2010

I'm building my first BASH programs and I have a hard time. I can't do a search in a folder and filter only script files without extension, the problem is to differentiate the script files from the others. I tried with ls I tried with find and i don't find a way to make it work.

View 8 Replies View Related

General :: Exec Command With Grep Output?

Feb 15, 2011

I have a requirement to find the files having its name as ack_reply. However, there are many other files in the same directory as these resides. Now I have to remove these files from the folder and retain others after 7 days. So I tried to write the below script with grep command.

find $directory -type f -mtime +7 | grep ack_reply

how can I pass this output to -exec command.

If I am not using grep command my script would be as

find $directory -type f -mtime +7 -exec remove.sh {}\;;

How can I use -exec with grep and find.

View 4 Replies View Related

General :: Specify More Than One String To Ignore (grep Command)?

Jul 28, 2010

I am using grep to filter out directories I am not interested in like this:svn stat | grep -v data/charts | grep -v lib/model | grep -v web/picsIt seems a bit "hacky". Is there a better way to specify more than one string to ignore, so that I dont have to chain multiple grep commands?

View 3 Replies View Related

General :: Command To Grep Complete Line

May 11, 2011

cat filename| awk '{print $3}' | cut -c -3 | cut -c 2- | grep 66

this returns the lines containing "66" at 2nd 2 characters of 3rd column of a line, now i need complete lines for this, how can i do it?

View 6 Replies View Related

General :: Difference Between Grep And Find Command?

Dec 24, 2010

For searching a file or directory i normally use grep command. kindly can you guide me the difference between grep and find command. I have used both but that are the difference between them ? are the same or grep is new as comapird to find command.

View 2 Replies View Related

General :: Can't Quit Terminal Command - Grep Some_word?

Sep 5, 2010

After typing "grep some_word" on terminal 6, the system doesn't do a thing, just lets me type endlessly. I've tried "Esc", "q" , [CTRL] + x, "exit" and no luck. I bet I'll kick my ass when you tell me but at the moment I can't figure it out. Rebooting would probably solve the problem but there must be a better way.

View 5 Replies View Related

General :: How To Use Grep To Display All Users Running Particular Command?

Mar 19, 2010

Can someone please tell me how I can use grep to display all users running a particular command.

View 3 Replies View Related

General :: Printing Image (Created Using Montage Command) With LPR

Oct 23, 2010

I have created an image out of 2 other images using the "montage" command. I want to then print it using "lpr". I view the output from montage in XV and it looks fine however when I try to print, it prints the bottom half of the first image then the second and then the bottom half again.

E.g., imagine this:
Code:
<< end of top image
<< end of bottom image

The above is how it looks in xv however when printed, it looks like:
Code:
-------
-------
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
//////////////////
//////////////////
-------
-------

I really can't understand it, I've tried opening and saving the image again but it still prints as above. I don't know if montage is outputting it incorrectly or something, however it looks right on the screen!

View 3 Replies View Related

General :: Need Command To Figure Out System A File Was Created On

Jan 31, 2010

I am just starting out in LINUX and I know the basic commands but I am a having a problem. I scoped the man pages but I can't get it. Maybe one of know... Can anyone tell me the cmd to figure out the system a file was created on? I just can't figure out this problem.

View 6 Replies View Related

General :: Find / Grep Command Without Searching Mounted Shares?

Jan 5, 2011

When I used the find command, I almost always need to search the local drives. But, I almost always have super large network shares mounted and these are included in the search. Is there an easy way to exclude those in the find command, grep and other similar commands? Example:

find / -name .vimrc

View 1 Replies View Related

General :: Get Files That Match ALL Patterns (using Grep)?

Jun 9, 2010

I want to traverse a directory and get a list of files that contain a set of patterns. I assumed I could use grep for this, but I having trouble getting grep to only return files that match ALL patterns. Here's what I've come up with so far:

Code:

grep --recursive --file=searchpatterns.txt --files-with-matches somedirectory/*

However, this gives me a list of files that match ANY of the patterns in the searchpatterns.txt file. I want to match ALL of the patterns. I've looked through the man page, but can't find anything that allows me to change the "OR" to "AND" for multiple patterns.

View 5 Replies View Related

General :: Searching For PHP Files With Find And Grep

Nov 2, 2010

I am looking for all the files that contain the text string 'moo.sql'. I ran the following:

find . -name '*.php' | grep -lir 'moo.sql' *

Unfortunately it seems to return non-php files in addition to php files. I thought the find portion of this would filter the file names so grep would only search php files.

View 3 Replies View Related

General :: Making Grep Find Files Containing '$'

Dec 5, 2010

I want to find files containing the "$" char (ascii 0x24). 'Grep -irl $ *' would output the names of every file in path *, of course, because it means end of line (EOL). So giving grep the string "$" won't do. So I tried 'grep -irl $ *'. But this doesn't work either and I do not understand why. Am I not escaping the dollar sign? grep should interpret it literally. Neither 'grep -irl "$" *' will work. Fortunately, there's LQ, besides grep's man page.

View 9 Replies View Related

General :: How To Remove All Files That Created N Minutes Ago

Mar 4, 2010

I guess in most cases when extracting a tar achive ,we will get a directory with the same name as the archive file but different suffix. but in some unlucky case, as I met today, after extract a tar bar I find lots of files spread in the working directory, which is really nuisance.so what I want to learn from you is that how can I move thoes newly created files ? I know it should be some "find plus rm" fancy approch there, but I don't know exactly how.

View 3 Replies View Related

General :: Can I Delete Files Created By Others In A Directory I Own

Jul 23, 2010

I created a directory somewhere with permissions rwxrwxr-x so that other users in my group can create files and directories in it.

I do need to be able to delete the contents in this "public" directory, but it seems that while I am able to remove any files in this directory I cannot remove and subdirectories under it.

Is there a way to remove such subdirectories owned by others under a directory owned by me?

View 3 Replies View Related

General :: Find Files That Have Been Accessed After They Were Created

Sep 10, 2010

With the find command it is easy to find files that have been modified or accessed within a given period. When a file is created, the acesss time is the same as the modify time. But as soon it is accessed (read), the access time changes, but the modify time does not. I need to find files that been accessed at all, ie. files which have access time newer than modify time. How do I do that?

View 2 Replies View Related

General :: 'all Files' Switch For Grep - Including 'hidden'?

Jun 14, 2010

If I type 'grep alias .bashrc' a whole load of stuff comes up. However, if I type 'grep alias *' nothing comes up. Is there some switch for including 'hidden' files - like the -a switch for ls?

View 2 Replies View Related

General :: Awk / Grep Or Sed - Find And Replace Recursively From Files

Feb 12, 2010

I am new to linux as well as awk, grep or sed. I need a find and replace command single liner or script that loops trough input file (file1) and find the particular input in file2 and add "!" in front of the found string.

Example:
input file: file1
g+h=o+p
a+b=c+d
file2 (file that need to look for)
a+b=c+d1e105
x+y=z+s5e105
g+h=o+pabcdefg
t+r=w+qxvyderf

Output file (file3 should look like this)
!a+b=c+d1e105
x+y=z+s5e105
!g+h=o+pabcdefg
t+r=w+qxvyderf

I have tried many awk and sed method of find and replce but it did not work the way I wanted. This is mainly due to my lack of experience in awk and sed. The program should loop trough file1 and find in file2 and output in file3 for the 1st (g+h=o+p) set then repeat the same process again for set 2 (a+b=c+d).

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved