S
S
Sergey Burduzha2017-08-17 09:00:42
ubuntu
Sergey Burduzha, 2017-08-17 09:00:42

How to zip and immediately copy the result to another folder in ubuntu using tar?

The task is to archive the test folder and immediately copy the result to the home directory.
tar -zcvf archive.tar.gz ./load.mp3 | cp ~/Downloads/ doesn't work that way, you need a second operand.
How will be correct? I always have problems copying and moving files after processing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-08-17
@serii81

tar -zcvf ~/Downloads/archive.tar.gz ./load.mp3
If you need 2 copies of the archive

tar -zcvf archive.tar.gz ./load.mp3 && cp archive.tar.gz ~/Downloads/archive.tar.gz

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question