Peng Yu <[email protected]> ha escrit:

> tar xvf something.tar
> 
> The above command by default extract the files to the current
> directory. How to extract it to some other directory

Either:

cd somedir; tar xvf /path/to/something.tar

or:

tar -C somedir -xvf /path/to/something.tar

> (if the directory doesn't exist, then create a new one)?

test -d somedir || mkdir somedir; ...

where `...' stands for one of above commands.

> Is there an option for this?

Nope, tar is not supposed to replace shell functionality in any way.

Regards,
Sergey


Reply via email to