Display file date after grepping a string in the file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Display file date after grepping a string in the file
# 1  
Old 05-22-2012
Question Display file date after grepping a string in the file

Hi All,

I need to recursively grep several folders for a MAC address and display the results with the date of the file name at the start. Even better would be if the final results were displayed chronologically so the newest file is always at the end. Oldest at the top, regardless of what directory it was in.

The search starts at

/opt/com21/nmaps/snmp/modemdata

EG:

Code:
root@NMAPS-A1 modemdata]# grep -r 0:15:a3:e2:f8:c7 * | sort -r

Output is (note there could be hundreds of results)
Code:
mish1/modemlevelsMish1.csv08092508:320:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-30,262,340,2771687393,10,0,2771765396,10,0
mish1/modemlevelsMish1.csv08092408:325:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,272,340,1650163261,3,0,1650241264,3,0
mish1/modemlevelsMish1.csv08092308:323:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,269,340,526142531,3,0,526142531,3,0
mish1/modemlevelsMish1.csv08092008:326:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-31,263,350,3912425699,6,0,3912425699,6,0
mish1/modemlevelsMish1.csv08091908:319:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-33,255,350,2788951199,6,0,2789029202,6,0
mish1/modemlevelsMish1.csv08091808:324:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-26,265,360,1664462990,6,0,1664540993,6,0
mish1/modemlevelsMish1.csv08091708:318:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-18,268,360,543875389,2,0,543875389,2,0
mish1/modemlevelsMish1.csv08091614:322:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,272,340,1542683488,10227,1034,1542683488,10227,1034
Knock7/modemlevelsKnock7.csv12020522:227:192.168.95.75,0:15:a3:e2:f8:c7,274000000,18600000,-23,266,330,,41602,0,704484102,41602,0
Knock7/modemlevelsKnock7.csv12020422:227:192.168.95.75,0:15:a3:e2:f8:c7,274000000,18600000,-9,273,320,2269039706,24149,0,2269229200,24149,0
Knock7/modemlevelsKnock7.csv12020321:230:192.168.95.75,0:15:a3:e2:f8:c7,274000000,,,275,320,3756465866,13229,0,3756465866,13229,0
Knock1/modemlevelsKnock1.csv12022122:80:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-66,241,340,469848408,19876103,10,469925662,19876851,10
Knock1/modemlevelsKnock1.csv12022022:68:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-63,229,340,3648043108,13423757,10,3648043108,13423757,10
Knock1/modemlevelsKnock1.csv12021922:62:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-48,256,330,2530162130,7754073,10,2530162130,7754073,10
Knock1/modemlevelsKnock1.csv12021822:70:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-45,259,320,1411569669,3419626,0,1411569669,3419626,0
Knock1/modemlevelsKnock1.csv12021722:80:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-59,232,330,290816964,1040554,0,290816964,1040554,0
Knock1/modemlevelsKnock1.csv12021622:8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-64,246,340,3148191623,22637172,678615,3148191623,22637172,678615
Knock1/modemlevelsKnock1.csv12021522:9:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-57,248,330,2039658009,8482050,360918,2039734114,8483880,360987
Knock1/modemlevelsKnock1.csv12021422:9:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-55,256,330,925261982,11,0,925339984,11,0
Knock1/modemlevelsKnock1.csv12021322:8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-51,258,330,4097068359,10,0,4097068359,10,0
Knock1/modemlevelsKnock1.csv12021222:8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-60,252,340,2974019233,10,0,2974019233,10,0
Knock1/modemlevelsKnock1.csv12021122:7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-53,252,330,1850779668,8,0,1850857670,8,0
Knock1/modemlevelsKnock1.csv12021022:6:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-62,250,340,727539103,8,0,727617105,8,0
Knock1/modemlevelsKnock1.csv12020922:5:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-54,260,340,3899376153,8,0,3899454155,8,0
Knock1/modemlevelsKnock1.csv12020822:7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-60,250,340,2776416010,7,0,2776494013,7,0
Knock1/modemlevelsKnock1.csv12020722:7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-59,253,330,1653310971,5,0,1653388974,5,0
Knock1/modemlevelsKnock1.csv12020622:8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-43,264,320,530476324,4,0,530554327,4,0

Id rather have

Code:
22-May-2012-Knock1/modemlevelsKnock1.csv12020622:8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-43,264,320,530476324,4,0,530554327,4,0

Etc..

Moderator's Comments:
Mod Comment Code tags for code, please.

Or truncate the file name part of the result to just the date part as all are format .csvYYMMDDHH and then display all results regardless of the directory chronologically.

Thanks in advance for any tips. Hope I explained it well enough.

These files are created daily and never written to again so I can go by time stamp of the file.

Q.

Last edited by Scrutinizer; 06-11-2012 at 10:59 AM..
# 2  
Old 05-22-2012
Where do you get 22-May-2012 from Knock1/modemlevelsKnock1.csv12020622 ?

What is your shell and operating system?
# 3  
Old 05-23-2012
Hello Neutronscott,

Its a bash shell and I'm writing a script using Fedora.
I want to append the 22-May-2012 bit to the start of the line for each result.

More importantly would be having the data listed in chronological order or just list the contents of the most recent directories. Its modem data on our network I'm looking at. The contents of the directory where the files are is as follows:


Code:
[
[root@NMAPS-A1 modemdata]# pwd
/opt/com21/nmaps/snmp/modemdata
root@NMAPS-A1 modemdata]# ls -ltr
total 848
drwxr-xr-x 2 root root  4096 Jan 17 07:14 knock10
drwxr-xr-x 2 root root  4096 Jan 27 11:20 fmtn3
drwxr-xr-x 2 root root  4096 Jan 27 18:03 Wmtn1
drwxr-xr-x 2 root root 12288 Jan 28 05:56 balling1
drwxr-xr-x 2 root root 36864 Jan 28 06:03 fmtn1
drwxr-xr-x 2 root root 32768 Jan 28 07:00 johns1
drwxr-xr-x 2 root root 36864 Jan 28 07:13 knock1
drwxr-xr-x 2 root root 45056 Jan 28 07:43 knock2
drwxr-xr-x 2 root root 24576 Jan 28 08:11 knock3
drwxr-xr-x 2 root root 36864 Jan 28 09:08 mish1
drwxr-xr-x 2 root root 36864 Jan 28 10:03 mish2
drwxr-xr-x 2 root root 24576 Jan 28 10:36 mish3
drwxr-xr-x 2 root root 40960 Jan 28 11:04 slieveb1
drwxr-xr-x 2 root root  4096 Jan 28 17:13 Knock8
drwxr-xr-x 2 root root  4096 Jan 29 22:01 Wmtn4
drwxr-xr-x 2 root root  4096 Feb  2 15:58 mtgabhcx
drwxr-xr-x 2 root root  4096 Feb  8 09:28 Knock10_4
-rw-r--r-- 1 root root 98443 Feb  8 10:47 Knock10all
drwxr-xr-x 2 root root  4096 Feb 15 22:01 Mish5
drwxr-xr-x 2 root root  4096 Feb 15 22:01 Mish3
drwxr-xr-x 2 root root  4096 Feb 17 14:27 comp
drwxr-xr-x 2 root root  4096 Feb 20 18:24 Knock9
drwxr-xr-x 2 root root  4096 Feb 23 19:18 reports
drwxr-xr-x 2 root root 24576 Feb 29 08:11 fmtn2
-rw------- 1 root root 21744 Feb 29 10:54 nohup.out
drwxr-xr-x 2 root root  4096 Mar  4 20:47 knock5
drwxr-xr-x 2 root root  4096 Mar  8 11:07 Knock7
drwxr-xr-x 2 root root  4096 Mar  8 11:10 Knock3
-rw-r--r-- 1 root root  1032 Mar 31 13:44 1.1
drwxr-xr-x 2 root root  4096 May 16 16:45 Knock11
drwxr-xr-x 2 root root 12288 May 22 22:01 Slieveb2
drwxr-xr-x 2 root root 12288 May 22 22:01 Slieveb1
drwxr-xr-x 2 root root  4096 May 22 22:01 Mish7
drwxr-xr-x 2 root root 12288 May 22 22:01 Mish4
drwxr-xr-x 2 root root 12288 May 22 22:01 Mish2
drwxr-xr-x 2 root root 12288 May 22 22:01 Mish1
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock2
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock10_3
drwxr-xr-x 2 root root 12288 May 22 22:01 Johnsw1
drwxr-xr-x 2 root root 12288 May 22 22:01 Forth3
drwxr-xr-x 2 root root 12288 May 22 22:01 Forth2
drwxr-xr-x 2 root root 12288 May 22 22:01 Balling1
drwxr-xr-x 2 root root  4096 May 22 22:01 Forth4
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock10_2
drwxr-xr-x 2 root root 12288 May 22 22:01 Forth1
drwxr-xr-x 2 root root  4096 May 22 22:01 Slieveb3
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock5
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock1
drwxr-xr-x 2 root root 12288 May 22 22:01 Wmtn3
drwxr-xr-x 2 root root 12288 May 22 22:01 Wmtn2
drwxr-xr-x 2 root root 12288 May 22 22:01 Coolg1
drwxr-xr-x 2 root root 12288 May 22 22:01 MtGab1
drwxr-xr-x 2 root root 12288 May 22 22:01 Clara1
drwxr-xr-x 2 root root 12288 May 22 22:01 Knock10_1
drwxr-xr-x 2 root root  4096 May 22 22:01 Forth5
drwxr-xr-x 2 root root 12288 May 22 22:01 Mish6
-rw-r--r-- 1 root root  1051 May 22 23:00 null
drwxr-xr-x 2 root root  4096 May 23 05:30 wmtn1
drwxr-xr-x 2 root root  4096 May 23 05:31 crushum1
drwxr-xr-x 2 root root  4096 May 23 05:34 cheekp1
drwxr-xr-x 2 root root  4096 May 23 05:34 clara1
drwxr-xr-x 2 root root  4096 May 23 05:34 duagh
drwxr-xr-x 2 root root  4096 May 23 05:34 bweeng1

So the only directories to be queried for the string is the directories last written to 1 day ago or with the current date.
# 4  
Old 05-23-2012
There's a few ways you can proceed with this. You can use find | sort in such a way that you recurisively search the directories, and sort output by the file timestamp. If the date is already at the end of ".csv" I don't see why you wouldn't use that.

but what I don't understand is why you prepend 22-May-2012 ? The current date? The files timestamp?

and is this really the end goal -- to just query an individual MAC from the command line? or will you merge this into a report for each MAC.
# 5  
Old 05-23-2012
Hi Netutronscott,

Nothing else is to be done with the data for now. Other non technical people will be looking at it and just need to easily review the data and clearly see the date. Eventually I need to work out the mean of values either.

I'm confusing you with the 22-May-2012 bit so disregard that.

I'm new enough to Linux but picking it up quick enough.

So if you could show me some code which will show the results of the MAC found in the csv files of which directories which were written to in the last 2 days and ignore other directories it would solve my problem for now..

Q
# 6  
Old 05-23-2012
put this in a file called recent_grep and "source recent_grep", then you can use the command

Code:
recent_grep() {
  (
    shopt -s nullglob
    # search only recent directories
    find . -type d -mtime -1 -print0 | while IFS= read -rd '' dir; do
      files=( "$dir"/*.csv???????? )
      # skip empty directory
      (( ${#files[@]} )) || continue
      for file in "${files[@]}"; do
        date=${file##*.csv}
        grep "$@" "$file" | while read -r line; do
          #prefix grep output with date
          printf '%s\t%s\t%s\n' "$date" "$dir" "$line"
        done
      done
    done | sort -r
  )
}

i re-created the data from your pastes. here is output.

Code:
[mute@geek ~/temp/quemalr]$ source recent_grep
[mute@geek ~/temp/quemalr]$ recent_grep 0:15:a3:e2:f8:c7
12022122        ./modemdata/Knock1      80:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-66,241,340,469848408,19876103,10,469925662,19876851,10
12022022        ./modemdata/Knock1      68:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-63,229,340,3648043108,13423757,10,3648043108,13423757,10
12021922        ./modemdata/Knock1      62:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-48,256,330,2530162130,7754073,10,2530162130,7754073,10
12021822        ./modemdata/Knock1      70:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-45,259,320,1411569669,3419626,0,1411569669,3419626,0
12021722        ./modemdata/Knock1      80:192.168.12.127,0:15:a3:e2:f8:c7,256000000,31400000,-59,232,330,290816964,1040554,0,290816964,1040554,0
12021622        ./modemdata/Knock1      8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-64,246,340,3148191623,22637172,678615,3148191623,22637172,678615
12021522        ./modemdata/Knock1      9:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-57,248,330,2039658009,8482050,360918,2039734114,8483880,360987
12021422        ./modemdata/Knock1      9:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-55,256,330,925261982,11,0,925339984,11,0
12021322        ./modemdata/Knock1      8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-51,258,330,4097068359,10,0,4097068359,10,0
12021222        ./modemdata/Knock1      8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-60,252,340,2974019233,10,0,2974019233,10,0
12021122        ./modemdata/Knock1      7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-53,252,330,1850779668,8,0,1850857670,8,0
12021022        ./modemdata/Knock1      6:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-62,250,340,727539103,8,0,727617105,8,0
12020922        ./modemdata/Knock1      5:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-54,260,340,3899376153,8,0,3899454155,8,0
12020822        ./modemdata/Knock1      7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-60,250,340,2776416010,7,0,2776494013,7,0
12020722        ./modemdata/Knock1      7:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-59,253,330,1653310971,5,0,1653388974,5,0
12020622        ./modemdata/Knock1      8:192.168.12.17,0:15:a3:e2:f8:c7,256000000,31400000,-43,264,320,530476324,4,0,530554327,4,0
12020522        ./Knock7        227:192.168.95.75,0:15:a3:e2:f8:c7,274000000,18600000,-23,266,330,,41602,0,704484102,41602,0
12020422        ./Knock7        227:192.168.95.75,0:15:a3:e2:f8:c7,274000000,18600000,-9,273,320,2269039706,24149,0,2269229200,24149,0
12020321        ./Knock7        230:192.168.95.75,0:15:a3:e2:f8:c7,274000000,,,275,320,3756465866,13229,0,3756465866,13229,0
08092508        ./mish1 320:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-30,262,340,2771687393,10,0,2771765396,10,0
08092408        ./mish1 325:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,272,340,1650163261,3,0,1650241264,3,0
08092308        ./mish1 323:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,269,340,526142531,3,0,526142531,3,0
08092008        ./mish1 326:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-31,263,350,3912425699,6,0,3912425699,6,0
08091908        ./mish1 319:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-33,255,350,2788951199,6,0,2789029202,6,0
08091808        ./mish1 324:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-26,265,360,1664462990,6,0,1664540993,6,0
08091708        ./mish1 318:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-18,268,360,543875389,2,0,543875389,2,0
08091614        ./mish1 322:192.168.22.253,0:15:a3:e2:f8:c7,250000000,24000000,-16,272,340,1542683488,10227,1034,1542683488,10227,1034

# 7  
Old 05-23-2012
Hi Neturon,

That is working, thanks so much. Some of the sub directories don't have .CSV files, this isn't a show stopper but if there is a way to ignore those directories names it would be nice. Again I really appreciate your help with this.

Q

Code:
-bash: :shopt: command not found
grep: ./*.csv????????: No such file or directory
grep: ./modemdata/*.csv????????: No such file or directory
grep: ./modemdata/clara1/*.csv????????: No such file or directory
grep: ./modemdata/duagh/*.csv????????: No such file or directory
grep: ./modemdata/crushum1/*.csv????????: No such file or directory
grep: ./modemdata/bweeng1/*.csv????????: No such file or directory
grep: ./modemdata/wmtn1/*.csv????????: No such file or directory

---------- Post updated at 02:31 PM ---------- Previous update was at 02:05 PM ----------

Hello Neutronscott,

I used your code as a function in my shell script and I'm sorted now. Thanks again for your great help.

Q.
Code:
Historical Data 
===============

Note CMTS name as modem may have been elsewhere.
Data is sorted by date. Continue (y/n)? y

12052222    ./Knock1    192.168.12.17,0:15:a3:5:f0:e8,256000000,24900000,-110,207,430,2570359452,902613,17,2570359452,902613,17
12052122    ./Knock1    192.168.12.17,0:15:a3:5:f0:e8,256000000,24900000,-105,212,420,1447627316,387299,17,1447705286,387332,17
12052022    ./Knock1    192.168.12.17,0:15:a3:5:f0:e8,256000000,24900000,-98,220,430,324776443,69203,0,324854437,69212,0
12051922    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-99,218,420,3657973345,728134,3,3657973345,728134,3
12051822    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-79,226,410,2534951716,504005,0,2534951716,504019,0
12051722    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-96,219,420,1411912195,297710,0,1411990190,297719,0
12051622    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-100,218,420,288944067,19916,0,289022068,19918,0
12051522    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-92,222,420,3862361193,2424643,16,3862361193,2424643,
12051422    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-97,214,420,2740329778,1210266,16,2740407725,1210322,16
12051322    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-98,218,400,1618342421,107815,16,1618420418,107821,16
12051222    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-92,224,420,495130594,73901,0,495130594,73901,0
12051122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-92,221,420,1095892783,2766410,25506,1095970783,2766414,25506
12051022    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-101,216,420,4268415343,2199364,25504,4268415343,2199364,25504
12050822    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-78,228,420,2022490844,1763857,25490,2022490844,1763857,25490
12050722    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-95,223,420,899802157,1206732,25467,899880157,1206735,25467
12050622    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-73,233,400,4071727996,1164950,25467,4071727996,1164950,25467
12050522    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-75,228,410,2948504596,1142367,25467,2948582599,1142367,25467
12050422    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-76,229,410,1825349711,1129414,25467,1825349711,1129414,25467
12050322    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-95,222,400,702352670,958581,25467,702430672,958582,25467
12050222    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-95,221,400,3874410136,804757,25467,3874488135,804761,25467
12050122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-76,229,400,2751352091,772715,25464,2751430094,772715,25464
12043022    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-76,231,410,1628112062,767048,25449,1628190065,767048,25449
12042922    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-74,229,390,505026077,763368,25449,505026077,763368,25449
12042822    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-71,231,390,3676672618,760438,25449,3676672618,760438,25449
12042722    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,236,400,2553508591,756755,25449,2553508591,756755,25449
12042622    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,237,390,1430342827,,25449,1430342827,754842,25449
12042522    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,235,390,307355087,748087,25449,307433091,748087,25449
12042422    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-73,230,400,3479079570,745253,25449,,745253,25449
12042322    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-71,,400,2355998680,736282,25444,2355998680,736282,25444
12042222    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-70,233,410,1232761331,727833,25444,1232839333,727833,25444
12042122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-71,231,400,109520177,723218,25444,109598180,723218,25444
12042022    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-72,233,,3281401739,719189,25444,3281479742,719189,25444
12041922    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,236,,2158235649,717457,25444,2158313652,717457,25444
12041822    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,234,390,1035214531,714665,25440,1035292534,714665,25440
12041722    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-91,226,390,4207018603,710075,25440,4207018603,710075,25440
12041622    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-90,224,400,3083858451,702531,25440,3083936454,702532,25440
12041522    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,235,410,1960696063,696864,25437,1960696063,696864,25437
12041422    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,,229,390,837451147,696017,25437,837451147,696017,25437
12041322    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,238,400,4009095573,695175,25437,4009173576,695175,25437
12041222    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-68,240,400,2886322256,690714,25433,2886322256,690714,25433
12041122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-68,239,400,1762843479,689656,25433,1762843479,689656,25433
12041022    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,,-69,240,400,639598897,688342,25433,639676900,688342,25433
12040922    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-68,239,390,3811554991,687794,25433,3811632994,687794,25433
12040822    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-72,235,390,2688389489,685563,25433,2688467492,685563,25433
12040722    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-72,232,390,1565066602,684596,25433,1565144605,684596,
12040622    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-74,230,390,441977600,683653,25433,442055604,683653,25433
12040522    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-61,239,390,3613888866,651768,70,3613966869,651768,70
12040422    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-70,244,380,2490559867,651531,70,2490637871,651531,70
12040322    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,245,380,1367476506,645091,70,1367476506,,70
12040222    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-69,235,390,244232014,643844,70,244310017,643844,70
12040122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-71,234,390,3416042062,633303,70,3416042062,633303,70
12033122    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-72,234,400,2292799278,630250,68,2292877281,630250,68
12033022    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-75,232,390,1169633582,628207,0,1169633582,628207,0
12032922    ./Knock1    192.168.12.50,0:15:a3:5:f0:e8,256000000,24900000,-105,213,370,46397918,617997,0,46475887,618031,0
12032722    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,242,410,3336289051,27343,40,3336289051,27343,40
12032622    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,239,410,2213063032,6803,40,2213063032,6803,40
12032522    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,240,410,1089818042,5333,40,1089896045,5333,40
12032422    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,238,400,13690718,14,0,13768721,14,0
12032322    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-60,242,400,3415637568,6050,0,3415637568,6050,0
12032222    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,232,400,2292394283,3467,0,2292394283,3467,0
12032121    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-61,242,400,1158387238,252,0,1158465241,252,0
12032022    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-61,244,400,45828016,19,0,45828016,19,0
12031922    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-62,243,400,3677644715,22607,2,3677722718,22607,2
12031822    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,247,390,2554555283,22340,0,2554633286,22340,0
12031722    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,243,390,1431153789,22098,0,1431231792,22098,0
12031622    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-61,241,400,308127482,21888,0,308127482,21888,0
12031522    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,234,410,3480083125,21758,0,3480161129,21758,0
12031422    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,242,400,2356759356,21601,0,2356837359,21601,0
12031322    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,240,400,1233690604,437,0,1233768608,437,0
12031222    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,237,400,110570664,18,0,110570664,18,0
12031122    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,243,410,3814741423,14969,1628,,14969,1628
12031022    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-78,236,430,2691419760,12715,1628,2691497763,12715,1628
12030922    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,236,400,1569292225,2521,0,1569292225,2521,0
12030822    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,241,420,445501799,1120,0,445579803,1120,0
12030722    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,245,390,3617280809,623,0,3617358812,623,0
12030622    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-61,242,400,2494035230,492,0,2494113233,492,0
12030522    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-67,248,390,1370945708,259,0,1370945708,259,0
12030422    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-67,247,390,247778209,43,0,247778209,43,0
12030322    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,246,390,3721129720,5485,16,3721129720,5485,16
12030222    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-71,245,400,2598946725,3544,16,2599024728,3544,16
12030122    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,238,400,1475884403,3252,16,1475884403,3252,16
12022922    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-62,240,400,353044477,2913,16,353122480,2913,16
12022822    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,245,400,3524825984,2783,16,3524903988,2783,16
12022722    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,239,400,2401911957,2107,16,2401989960,2107,16
12022622    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-62,235,400,1278901527,784,0,1278901527,784,0
12022522    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-63,240,390,155500501,5,0,155578504,5,0
12022422    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,,246,410,1164020267,932,0,1164098270,932,0
12022322    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-69,236,400,40679820,11,0,40757823,,0
12022222    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-74,236,410,2223444155,990,30,2223444155,990,30
12022122    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,239,400,1100601616,214,0,1100679619,214,0
12022022    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-68,239,390,2047387718,8516,210,2047387718,8516,210
12021922    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-65,252,390,923908361,8141,209,923986364,8141,209
12021822    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,249,400,4095946676,3440,157,4095946676,3440,157
12021722    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-71,243,390,2972953179,2763,157,2972953179,2763,157
12021622    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,,239,390,1849873806,741,2,1849873806,741,2
12021522    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-63,236,400,726878881,677,2,726956884,677,2
12021422    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,244,390,3898600483,600,2,3898600483,600,2
12021322    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-71,241,390,2775509663,496,2,2775587667,496,2
12021222    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-71,242,390,1652694418,459,2,1652694418,459,2
12021122    ./Knock1    192.168.12.86,0:15:a3:5:f0:e8,256000000,31400000,-70,243,390,529682051,196,2,529682051,196,2
12020922    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-69,237,400,1398404488,246,0,1398482492,246,0
12020822    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-68,234,390,275157614,23,0,275235618,23,0
12020722    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-61,241,390,565317184,18025,0,565395187,18025,0
12020622    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,,31400000,,223,390,,,,3739035373,15588,
12020522    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-68,239,390,2614990117,172,0,2615068120,172,0
12020422    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-66,249,390,1492134211,96,0,1492134211,96,0
12020321    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-69,247,390,334127803,49,0,334205806,49,0
12020222    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-57,258,380,2952964014,468,322,2953042018,468,322
12020122    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-51,264,380,1829406262,438,322,1829484265,438,322
12013122    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-59,257,380,707012778,414,0,707012778,414,0
12013022    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-68,247,390,3878375400,384,0,3878375400,384,0
12012922    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-68,239,390,2755034686,357,0,2755034686,357,0
12012822    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-71,244,390,1632802728,245,0,1632802728,245,0
12012817    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,,242,390,1410649645,220,0,1410727649,220,0
12012722    ./Knock1    192.168.12.234,0:15:a3:5:f0:e8,256000000,31400000,-67,248,390,509478854,125,0,509556857,125,0

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies

2. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies

3. AIX

How do I display a file's last modified date?

I'm using a script that I need to get a file's "last modified date" in a format like 01:51:14 PM. We are running on AIX 6.1.0.0. I can't seem to find the right command parameters. Help! (4 Replies)
Discussion started by: mattadams1983
4 Replies

4. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

5. Shell Programming and Scripting

Display lines of two date range from syslog file

Hi Guys, I want to display lines from Solaris syslog file but with 2 dates range. I have some similar solution (https://www.unix.com/shell-programming-scripting/39293-grep-log-file-between-2-dates-4.html) which works fine but as you know syslog has different date format (Jan 22) so this is not... (1 Reply)
Discussion started by: prashant2507198
1 Replies

6. HP-UX

find command to display size and date of a file

Hi, The blow code does not yeild any output. find . -name "*.jar" -o -name "*.ksh" -o -name "*.properties" -name "*.war" -o -name "*.ear" -o -name "*.sh" -o -name "*.cfg" -exec ls -l {} \; I wish to print the filename filesize filedate in HP-UX. Can anyone help ? (9 Replies)
Discussion started by: mohtashims
9 Replies

7. Shell Programming and Scripting

How to search for file and display by date

I like "ls -ltr". I would like to search for a file in a large directory recursively and and display all the candidates in reverse order. /usr/bin/find . -name \*.txt This works. How do I display the date and sort the file names by the date in reverse order for the entire directory... (1 Reply)
Discussion started by: siegfried
1 Replies

8. AIX

Help with looping a file and grepping a string

I have 2 files: fileA and fileB. content of fileA --------------- admin.teacher is in new york; admin.mason is in new york; admin.driver is in new york city; user.trucker is in hartford; admin.developer is in new york state; content of fileB ---------------- admin.teacher is in... (8 Replies)
Discussion started by: lowprofile
8 Replies

9. Shell Programming and Scripting

Grepping string from out file

Guys .. Need to pull this highlighted strings irrespective of line numbers & should be echoed . But these strings are from Outfile from different dir. In which way this can be grepped ?? Need an idea http-timeout 120 seconds persistent-timeout 180 seconds host-rewriting on ... (7 Replies)
Discussion started by: raghunsi
7 Replies

10. Shell Programming and Scripting

display the file with in the date range

Hi All, I want a shell script which can display the file with in the date range. For Example I have 15 files with the following format abc_01-01-2009.txt to abc_15-01-2009.txt. Now I want to have the files between 4th of jan to 12th files. How can I acheive this. Advance... (1 Reply)
Discussion started by: fareed_do
1 Replies
Login or Register to Ask a Question