Spaghetti is from Southern Italy. It's the classic, the workhorse. It's been around for centuries. Linguine is specific to the Liguria region (where they make pesto). Yes, pesto and linguine are a match made in heaven.
Pesto is oily and herby, and those flat ribbons grab it perfectly. If you use spaghetti for pesto, you'll be fine. But linguine makes it sing. It's like the pasta was built for that green goodness.
Linguine And Spaghetti Difference at Kate Terry blog