I have a site that's using software throwing out some extra pages that I want to get rid of, but they're two folders deep so I wanted to double check the correct syntax.

So, if the site is in this format:

example.com/folder1/folder2/

And I want to block folder2 but not folder1 would it be:

User-agent: *
Disallow: */folder2/

Note: /folder2/ appears at the end of many URLs not just folder 1.