Hi...
I try to use the following command to search a string:
find . -type f -name "*.log" -mtime -2 |xargs grep '08:25:39'
The output is like:
...
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Account" at 5063ba48
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Account" at 57fa31f8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Employee" at 30c8d398
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Employee" at 586f0cd8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Responsibility" at 506f6ea8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Responsibility" at 586f60d8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Account" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Employee" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Response" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Account" at 5063ba49
...
Is there a way to list only the unique file name? as I only interest if a file contains that string.
Regards,
Dangwo
I try to use the following command to search a string:
find . -type f -name "*.log" -mtime -2 |xargs grep '08:25:39'
The output is like:
...
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Account" at 5063ba48
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Account" at 57fa31f8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Employee" at 30c8d398
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Employee" at 586f0cd8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Responsibility" at 506f6ea8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 Begin: construct BusComp "Responsibility" at 586f60d8
./EngAppMgr_0008_8388884.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Account" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Employee" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Response" at 5063ba48
./EngAppMgr_0008_9989343.log:ObjMgrBusCompLog Create 4 000011a8582900b2:0 2019-07-09 08:25:39 End: construct BusComp "Account" at 5063ba49
...
Is there a way to list only the unique file name? as I only interest if a file contains that string.
Regards,
Dangwo