tar and untar the files using single line

Hi,
i want tar the files from one location and untar it to other location using single line.
Can any one help me

zip and unzip using single line command.

tar cvf - | ( cd /another/place; tar xf -)

I don't get the zip question. -c writes to stdout
What is you want to do, it makes no sense to zip & unzip? You zip to work with smaller files, then unzip them later.

Expanding on jim_mcnamara solution: you could use an intermediate file instead of a pipeline if you don't want to write the archived files immediately OR if you want to unarchive them to several places. Only in this case it makes sense to use compression because if you immediately restore the files to another place (regardless of this place being on the same system or not) it is easier to send the files uncompressed.

The pipeline in jim_mcnamaras code has - for the purpose of this thread - unlimited bandwidth, so it doesn't matter how much data you pipe through. It still does matter, though, to use one processore for compressing and another one for uncompressing the data.

The same is true for a network connection: network bandwidth is - in most instances, if not this would be a very rare exception - available in bigger quantities than processing time, therefore it is still cheaper to use

# tar -cf - /some/dir | ssh root@othermachine "cd /some/dir ; tar -xf -"

then to squeeze the stream through zip on one system and unzip on the other.

I case you still want to use compression:

archive and compress:
# (cd /some/dir ; tar -cf - . | gzip [-9] > /somewhere/file.tar.gz

uncompress and restore:
# gzip -cd /somewhere/file.tar.gz | (cd /some/dir; tar -xf - )

I hope this helps.

bakunin