I am looking for ways getting line number when using especially 'cat'.
I tried this command on the ubuntu 16.04 like this
cat flux.log |grep "statistic"
And This is the results when finding out information.
Using fit statistic: chi
Using test statistic: chi
Fit statistic : Chi-Squared = 175.92 using 16 PHA bins.
Test statistic : Chi-Squared = 175.92 using 16 PHA bins.
Fit statistic : Chi-Squared = 175.92 using 16 PHA bins.
Test statistic : Chi-Squared = 175.92 using 16 PHA bins.
Fit statistic in use: Chi-Squared
Using fit statistic: chi
Using test statistic: chi
Fit statistic : Chi-Squared = 175.92 using 16 PHA bins.
Test statistic : Chi-Squared = 175.92 using 16 PHA bins.
Fit statistic : Chi-Squared = 6.05 using 16 PHA bins.
Test statistic : Chi-Squared = 6.05 using 16 PHA bins.
Fit statistic : Chi-Squared = 6.05 using 16 PHA bins.
Test statistic : Chi-Squared = 6.05 using 16 PHA bins.
Fit statistic : Chi-Squared = 6.05 using 16 PHA bins.
Test statistic : Chi-Squared = 6.05 using 16 PHA bins.
Fit statistic : Chi-Squared = 6.05 using 16 PHA bins.
Test statistic : Chi-Squared = 6.05 using 16 PHA bins.
Fit statistic : Chi-Squared = 6.05 using 16 PHA bins.
Test statistic : Chi-Squared = 6.05 using 16 PHA bins.
Fit statistic : Chi-Squared = 66.15 using 16 PHA bins.
Test statistic : Chi-Squared = 66.15 using 16 PHA bins.
Fit statistic in use: Chi-Squared
Using fit statistic: chi
Using test statistic: chi
Fit statistic : Chi-Squared = 66.15 using 16 PHA bins.
Test statistic : Chi-Squared = 66.15 using 16 PHA bins.
In this results, i want to last lines for catching information.
Fit statistic : Chi-Squared = 66.15 using 16 PHA bins.
Test statistic : Chi-Squared = 66.15 using 16 PHA bins.
the problem is there are many lines and these numbers that are written are random. So i just have information such as "Fit","Test","statistic" or "Chi-Squared" to finding.
If these results have line number and could get distinguished, i can be find the line i want to. Is there somebody help me?
ps, i have tried this command
<cat -n flux.log |grep "statistic">
but all of lines are different each file.