C
C
crescent2016-05-11 08:41:53
bash
crescent, 2016-05-11 08:41:53

Number of lines of code from *.coffee and *.py files in bash?

Can you tell me a command that returns the number of lines of code from *.coffee and *.py files on the bash in the project?
The project has a bunch of files, all extensions.
It is necessary to execute a command in the root directory on the bash so that it recursively goes through all the files and counts.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2016-05-11
@crescent

find ./ -type f \( -name "*.py" -o -name "*.py" \) -exec wc -l {} \; | awk '{sum+=$1} END{print sum}'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question