4
rated 0 times
[
4]
[
0]
/ answers: 1 / hits: 1221
/ 1 Year ago, tue, may 2, 2023, 6:06:09
I sometime need to check some logs and I do this with this command:
egrep -o "success|error|fail" <filename> | sort | uniq -c
Sample input:
test error on line 10
test connect success
test insert success
test started at 00:00
test delete fail
Sample output:
1 error
1 fail
2 success
I would like to know if someone knows a way to do this with a shorter command?
Before you ask why I would like to do this with an different command... No special reason, I'm just curious :)
More From » command-line