This example customizes the layout with template.templ and the style with style.css.

Count lines

Raw Markdown View this page on GitHub

Count lines

-l counts lines alone. With more than 1 file, wc adds a total:

$ wc -l main.go util.go
     120 main.go
      45 util.go
     165 total

Count the files of a project

Git lists the files that it tracks, and xargs passes them to wc:

git ls-files | xargs wc -l

Warning

wc counts newline characters, so it misses a last line without one: printf 'a\nb' | wc -l prints 1.