简体   繁体   中英

Query regarding tar

I am doing tar of multiple files using absolute paths and sending the tar files to another server. While doing untar at target location my tar command is failing as it is not able to find the files.

Command which i used to tar and zip
tar -cf - list_of_file_names | gzip > output_file.tar.gz

and
Command to unzip and untar
gzip -dc output_file.tar.gz | tar -xf -

Is there any way possible to untar those files without getting any error ?

Why I see this, I'm usually trying to untar into a directory which I don't have write permissions for.

BTW, a more compact version of your commands:

tar czf output_file.tgz list_of_file_names

tar xzf output_file.tgz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM