HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

loc — Count lines of code. Written in Rust. More information: <https://github.com/cgag/loc>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
linescommandrustwrittenclicodecountloc

Problem

How to use the loc command: Count lines of code. Written in Rust. More information: <https://github.com/cgag/loc>.

Solution

loc — Count lines of code. Written in Rust. More information: <https://github.com/cgag/loc>.

Print lines of code in the current directory:
loc


Print lines of code in the target directory:
loc {{path/to/directory}}


Print lines of code with stats for individual files:
loc --files


Print lines of code without .gitignore (etc.) files (e.g. two -u flags will additionally count hidden files and dirs):
loc {{[-u|--unrestricted]}}

Code Snippets

Print lines of code in the current directory

loc

Print lines of code in the target directory

loc {{path/to/directory}}

Print lines of code with stats for individual files

loc --files

Print lines of code without `.gitignore` (etc.) files (e.g. two `-u` flags will additionally count hidden files and dirs)

loc {{[-u|--unrestricted]}}

Context

tldr-pages: common/loc

Revisions (0)

No revisions yet.