Extract only the contents of an archived directory from within an archive

Solution 1:

Use

 tar -xvzf filename.tar.gz --strip-components=1

--strip-components=1 tells tar to strip the first path component (the drupal-7.15/ in your case) from each file when unpacking.