This doesn't work:tar xf /tmp/foo.tar.gz foo/bartar: foo/bar: Not found in archiveIt's not obvious to me what would do this beyond extracting it in place and moving the files over.
How do I extract with tar to a different directory?
tar
From man tar:     -C directory         In c and r mode, this changes the directory before adding the         following files.  In x mode, change directories after opening the         archive but before extracting entries from the archive.i.e, tar xC /foo/bar -f /tmp/foo.tar.gz should do the job.(on FreeBSD, but GNU tar is basically the same in this respect, see Changing the Working Directory in its manual)