Quantcast
Channel: Count the occurrences of a string in a file - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

Count the occurrences of a string in a file

$
0
0

I have a file as below.

A      ctrl/bng/h2ert/scratch/TestAccountService.java
A      ctrl/bng/h2ert/scratch/TestAccount.java
A      ctrl/bng/h2ert/scratch/TestT.java
A      ctrl/bng/h2ert/scratch/TestAccountService.jpg
A      ctrl/bng/h2ert/scratch/TestService.txt
A      ctrl/bng/h2ert/scratch/TestAccountService.txt

I want to list all .java files names from the above, like

Total java file 4

then file name


Viewing all articles
Browse latest Browse all 4

Trending Articles