Yesterday, I have seen Linux kernel source code. There were thousands of lines. Were all code written only by one person, Linus Torvalds?
3 Answers
No. Linus is not the only one writing the Linux kernel source code, and I think that you'll find that the Linux Kernel is more than "thousands" of lines of code (it's closer to 12-15 million lines, depending on how you count).
See e.g. the top 100 contributors mentioned here: https://github.com/torvalds/linux/graphs/contributors
Notice how Linus (at the moment) is the #39 most frequent contributor in terms of number of commits.
See also the text in the section "Developer Community" of the "Linux Kernel" Wikipedia article, which states
As of 2007, the development of the kernel had shifted from the top 20 most active developers writing 80% of the code to the top 30 writing 30% of the code, with top developers spending more time reviewing changes.
[...]
About 1500 developers are contributing to each release from about 200-250 companies on average per release. The top 30 developers contributed a little more than 16% of the code. As of companies, the top contributors are Intel (12.9%) and Red Hat (8.0%), the third and fourth places are held by the 'none' (7.7%) and 'unknown' (6.8%) categories.

- 333,661
With respect to the "Linux kernel development report of 2017". There are 1681 developers from 255 companies. For more information.
Linus Torvalds is most likely one of the persons who contributed the lowest amount of code to the project. His contribution is much less than 1%. Have a look at the source code that lists all contributors....
Since he destroyed the complete history from before 2004, you need to be very careful if you like to meter his contributions.

- 19,173