Compress Multiple Directories or Files at Once

Configurare noua (How To)

Situatie

Solutie

While tar is frequently used to compress a single directory, you could also use it to compress multiple directories. Just provide a list of files or directories instead of a single one. For example, let’s say you want to compress the /home/ubuntu/Downloads directory, the /usr/local/stuff directory, and the /home/ubuntu/Documents/notes.txt file. You’d just run the following command:

tar -czvf archive.tar.gz /home/ubuntu/Downloads /usr/local/stuff /home/ubuntu/Documents/notes.txt

Just list as many directories or files as you want to back up.

Tip solutie

Permanent

Voteaza

(4 din 5 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?