careful though, linux is not unix and does not contain any unix code, since unix is a proprietary OS copyrighted to AT&T Bell, BSD is not unix either and it contains no unix code.
BSD is based on unix though, it has been changed so much internally that no Bell Labs code exists in current distros though. Linux is based on minix, though i think i am right in saying no minix code exists in linux. minix is a small OS written specifically to show students of computer science how an OS works. minix has no unix code, linux has no unix or minix code.
BSD, linux and unix apparently are all incredibly similar from the point of view of somebody using them though, i wouldn't know from first hand experience but from what i read, a lot of effort has gone into cloning as much as possible from one proprietary environment to another free, open source environment.
a round of applause for that i say!