Странице

Ознаке

четвртак, 21. март 2013.

Linux untar to remote location or just to local directory

A few examples how to untar data to remote location:
ssh remotehost (cd /tmp ; tar xvf test.tar)
ssh remotehost "cd tmp ; tar xvf test.tar"
Or stream
cat test.tar | ssh remotehost "cd tmp ; tar xvf -"
cd /where/the/original/data/is ; tar -cf - . | ssh remotehost "cd tmp ; tar xvf -"
Untar to directory:
tar -C <directory> -zxvf tarball.tar.gz
Tar and gz specific directory:
 tar -cvzf tarball.tar.gz <FOLDER_TO_COMPRESS>
 Extract a single file from a .tar.gz file:
 gunzip -c /path/to/folder/filename.tar.gz | tar -xvf - path/within/archive/filename.php

Нема коментара:

Постави коментар

Напомена: Само члан овог блога може да постави коментар.