To control the directory structure of your archive use the
-C Option. tar changes into the specified directory and starts archiving right away. Files that should go into the archive should be specified relative to that specified archive.
So to archive a directory
tar cfj /home/user/foo/bar/go would let tar preserve the directory structure inside our archive. To just archive contents under
go in our archive, we have to tell tar to jump into
/home/user/foo/bar/. From there on, we tell tar to archive
tar cfj newarchive.tar.bz2 -C /home/user/foo/bar go/
If you want to get in touch with me, send me an email