Bring a large pot of salted water to a boil. Cook the spaghetti or linguine according to package instructions until al dente. Reserve 1/2 cup of pasta water, then drain the pasta and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and red pepper flakes, sautéing for about 1 minute until fragrant.
Stir in the diced tomatoes, black olives, capers, and oregano. Season with salt and pepper. Simmer for about 10 minutes, allowing the sauce to thicken slightly.
Add the cooked pasta to the skillet, tossing to combine. If the sauce is too thick, add some reserved pasta water to reach your desired consistency.
Serve immediately, garnished with chopped parsley and grated Parmesan cheese if desired.