27

According to the Open Hub website, Linux has 37,016,567 lines of code, but this is small compared to NetBSD and OpenBSD, which have 72,065,568 and 81,902,070 lines of code, respectively.

Is there a reason why Linux has fewer lines of code compared to NetBSD and OpenBSD? I'd like to know.

top 10 comments
sorted by: hot top controversial new old
[-] mech@feddit.org 68 points 9 months ago

You're comparing a kernel with an entire operating system.

[-] vext01@lemmy.sdf.org 12 points 9 months ago
[-] mrus@lemmy.sdf.org 31 points 9 months ago

Your numbers don't check out, please provide sources. The Linux Kernel has around 40 million lines, the OpenBSD kernel around 7. You might have mistakenly counted OpenBSD/NetBSD as a whole system (the base installation), instead of solely the kernel.

[-] DFX4509B@lemmy.wtf 10 points 9 months ago* (last edited 9 months ago)

Given BSD is supposed to be a complete package while Linux has a separate kernel and userland, that's probably why.

[-] beutlin@feddit.org 7 points 9 months ago

Doesn't mean anything. Lines of Code is a stupid metric because it's just an absolute count. Not relative to any implemented functions, not imaging the actual density. Especially stupid because you can easily tweak the count by bloating a function.

[-] PanArab@lemmy.ml 1 points 9 months ago* (last edited 9 months ago)

This is why I typically refer to it as GNU+Linux and not just Linux. Two different and incompatible operating systems can use the same kernel just look at Android and GNU+Linux. Each of the BSDs is a complete operating system (userland + kernel).

[-] xylogx@lemmy.world 1 points 9 months ago* (last edited 9 months ago)

Is that more than the kernel? How much more?

[-] Goretantath@lemmy.world 1 points 9 months ago
[-] strlcpy@lemmy.sdf.org 28 points 9 months ago

No one who ever had anything to do with OpenBSD or NetBSD would venture such a "best guess"

[-] vext01@lemmy.sdf.org 12 points 9 months ago

Ah yes. OpenBSD. Well known for bloat...

Come on.

this post was submitted on 16 Nov 2025
27 points (100.0% liked)

Open Source

48640 readers
329 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 7 years ago
MODERATORS