Cannot set target directory when extracting an archive using tar

view full story

http://serverfault.com – I'm trying to extract a tar archive to a specific directory. I've tried using -C flag but it doesn't work as expected. Here is the commandline I'm using tar xvf myarchive.tar -C mydirectory/ This gives me a following error: tar: file -C: not present in archive tar: file mydirectory/: not present in archive I've also tried setting the -C flag before the archive file but it just says this: tar xvf -C mydirectory/ myarchive.tar tar: -C: No such file or directory What am I doing wrong? EDIT: Quanta asked for this, I have no idea why. tar -tf myarchive.tar herareport/ herareport/bin/ .. (HowTos)