The lightning-fast line counter for source projects.
linebolt is a lightweight, high-performance command-line tool written in C that traverses directories and counts the total number of lines in source code files — fast. Originally designed for .c and .h files, it's engineered to scale to massive codebases like the Linux kernel, and flexible enough to support any extension (.py, .cpp, .yaml, etc.).
- 10× faster than
clocon large codebases - Handles massive trees like the Linux kernel in under 10 seconds
- Accurate even for files without a trailing newline
- POSIX-compatible (Linux, macOS)
- Counts lines in all
.cand.hfiles by default - Non-recursive traversal using an internal stack (no malloc, no crashes)
- Skips irrelevant directories (
.git,build,bin, etc.) - Correctly counts files without final newline (unlike
wc -l) - Ignores empty files (zero-character files)
- Designed for Linux and other POSIX systems
- Ultra fast — C standard library only
Future roadmap:
- Custom extension filtering (
--ext py,cpp) - Blank/comment line exclusion
- JSON or CSV output mode
- Per-directory summaries
You need a POSIX-compatible system (Linux, macOS) and GCC or Clang installed.
gcc -Wall -Wextra -o linebolt linebolt.cTo count all .c and .h lines in the current directory:
./lineboltOutput includes line counts per file and a total at the end.
12 lines ./include/util.h
9 lines ./src/helpers.c
=============================
Total lines: 44
Unlike cloc, linebolt counts all matching files — even if their contents are byte-for-byte identical.
This ensures line counts reflect what actually exists in the repository, rather than deduplicating identical files. As a result, linebolt may report slightly higher totals on projects that contain copied or duplicated files (e.g., vendored libraries, backups, or symlinks).
In testing on the Linux kernel,
lineboltreported about 1% more lines thancloc, due to this intentional difference.
By default, linebolt skips common non-source folders:
.git.svnbinbuildobj
You can customize this in should_ignore_dir() in the source code.
MIT License (see LICENSE)
Author: Zülfü Serhat Kük
Year: 2025
Want to extend it to support other languages or formats? Want blazing-fast CSV or JSON output? Open a pull request or submit an issue.
