Using the following example, I need to filter out the line containing 'ABC' only, while skipping the lines matching 'ABC' that contain square brackets:
2012-04-04 04:13:48,760~sample1~ABC[TLE 5332.233 2/13/2032 3320392]:CAST 2012-04-04 04:13:48,761~sample2~ABC 2012-04-04 04:13:48,761~sample3~XYZ[BAC.CAD.ABC.CLONE 232511]:TEST
Here is what I have, but so far I'm unable to successfully filter out the lines with square brackets:
bash-3.00$ cat Metrics.log | grep -e '[^\[\]]' | grep -i 'ABC'
Please help?