Cook the spaghetti or linguine according to package instructions in a large pot of salted boiling water until al dente. Reserve 1 cup of pasta water, then drain the pasta.
In a large skillet over medium heat, add the olive oil. Once hot, add the minced garlic and red pepper flakes (if using). Sauté for about 1-2 minutes until fragrant, being careful not to burn the garlic.
Add the drained pasta to the skillet and toss to coat in the garlic oil.
Stir in the lemon zest and juice, then gradually add the reserved pasta water, a little at a time, until you reach your desired sauce consistency.
Remove the skillet from heat and mix in the grated Parmesan cheese. Stir until the cheese is melted and the pasta is well coated. Season with salt and black pepper to taste.
Serve immediately, garnished with chopped parsley and additional Parmesan if desired.