Difference between revisions of "Packing and unpacking files"

From Linuxintro
imported>ThorstenStaerk
m
imported>ThorstenStaerk
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Here are the most practical [[commands]] to pack and unpack files in a [[console]]:
+
Here are the most practical [[commands]] to pack and unpack files in a [http://simple.wikipedia.org/wiki/Command_Line_Interface console]:
  
 
= Unpacking =
 
= Unpacking =
  [[unrar]] x filename.rar
+
  unrar -kb x filename.rar
  
 
  [[unzip]] filename.zip
 
  [[unzip]] filename.zip
Line 16: Line 16:
  
 
  tar cvf targetfile.tar /sourcedir
 
  tar cvf targetfile.tar /sourcedir
 +
 +
When using really large files, for example when you [[clone a computer]] it pays to use a program that can use all your processor threads in parallel. pigz is a good choice for that. To draw a backup from your harddisk:
 +
cat /dev/sda | pigz -c >test
 +
 +
Unpacking can then be done with
 +
pigz -d -c test >/dev/sd''x''
  
 
= See also =
 
= See also =
 
* [[cpio]]
 
* [[cpio]]

Latest revision as of 15:02, 20 March 2015

Here are the most practical commands to pack and unpack files in a console:

Unpacking

unrar -kb x filename.rar
unzip filename.zip
bunzip2 filename.bz2
tar xvf filename.tar
tar xvzf filename.tar.gz

Packing

tar cvzf targetfile.tar.gz /sourcedir
tar cvf targetfile.tar /sourcedir

When using really large files, for example when you clone a computer it pays to use a program that can use all your processor threads in parallel. pigz is a good choice for that. To draw a backup from your harddisk:

cat /dev/sda | pigz -c >test

Unpacking can then be done with

pigz -d -c test >/dev/sdx

See also