Comment

Peter Bengtsson

that only applies if you know that you want to put it in folder.

Parent comment

Ng Pheng Siong

$ (mkdir foo; cd foo; tar xovf ../foo-xyz.tgz) The parens means run all commands in the same shell child process - this makes the "cd" stick for the subsequent "tar". The shell is for scripting too.