When I tar
a single file, I can give the tar
file a desired name:
$ tar -cvfj A B
I would like to do the same when I untar a single file.
$ tar -xvjf A tmp
(ie. extract A
into tmp
).
I was trying to do this using mv
:
$ tar -xvjf $1 | mv $1 tmp
That didn't work. $1
can be an arbitrary name, but the tar
files will always be a single file, no folders (this is guaranteed).
tar
for compression? If so, don't do that; just use the compression program directly (bzip2
in your case)j
in your first example, it is broken.-C
:tar -xvjf $1 -C tmp