문제

I know that this script: find . -name '*' | xargs wc -l will count all the lines of code recursively in a directory, however since I am using plugins, the script will count those too.

I just want to be able to count the lines of code that I have written. If I add a commented string to each file that I write, how will I modify that script so it only counts files containing that specific string (perhaps something like originalCode-01-NoPlugin-).

Thanks in advance.

도움이 되었습니까?

해결책

grep -rl 'originalCode-01-NoPlugin-' ./ | xargs wc -l does the trick, thanks for pointing me in the right direction @devnull

It first finds the files and then counts the lines of code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top