Rayn D Rayn D - 1 month ago 6x
Javascript Question

Extract tar file after copy without success

Im copy tar file form folder A to folder B and I want that when
it finish to copy it to unzip it, I try with the following in my shell script which doesnt work,any idea?

cp /home/i557956/A/file.tar /home/i557956/B
tar -xvf /home/i557956/B/file.tar

The copy was success but the tar is not extracted in B folder...


Try to move into the B folder before extracting:

cp /home/i557956/A/file.tar  /home/i557956/B
(cd /home/i557956/B/ && tar -xvf file.tar)