Out of curiosity, I did blame on some files in the FreeBSD source code (https://github.com/freebsd/freebsd). In core utilities like "cat", "kill" and "mv", there are still quite a few lines dating back all the way to the original commits of BSD 4.4 Lite source 24 years ago. Example:
And if you look at lines that were changed, quite often they are style changes/fixes.
Unfortunately, the easy-to-trace history doesn't go back further than that, but I think it's reasonable to assume that some of these lines, at least, could be dated back to before 1987.
But BSD was a rewrite too. I don't know what the mix of Unix versions in common use was 30 years ago, but I assume AT&T's original was up there. That's the version I started with around that time period.
I was actually assuming that most people today were running Linux, but I forgot that Macs use pieces of BSD.
As far as I know, BSD never did a complete rewrite touching every single line of code. They rewrote the code that was inherited, or derived from, AT&T Unix. Which was most of it, but not everything.
On the contrary, there is a lot that is not rewritten at all.
For starters: The Unix that I (and quite a lot of other people) use today shares entire manual pages with the Unix of more than 30 years ago.
An example: The manual page for the ul command that was written by (then) Mark Horton is pretty much unchanged today in FreeBSD and NetBSD. For 34 years, it hasn't actually described the command correctly or fully.
https://github.com/dspinellis/unix-history-repo is a project that attempts to document Unix from its very first line all the way up to FreeBSDs HEAD (at least whenever it's imported, which might only be once a year). There's even a gource video showing the evolution.
Unix itself.