domenica 7 agosto 2011

A very minimal guide to the tar command

to extract from an archive
  • for .tar use tar -xvf [archiveName] 
  • for .tar.gz, .tgz  use tar -xvzf [archivefile]
  • for .tar.bz2, .tbz2, .tbz  use tar -xvjf [archivefile]
  • for .tar.Z than use tar -xvZf [archivefile}
to compress a folder or a list of files
  • for .tar use tar -cvf [archiveName] [pathname ...]
  • for .tar.gz, .tgz  use tar -cvzf [archiveName] [pathname ...]
  • for .tar.bz2, .tbz2, .tbz  use tar -cvjf [archivename] [pathname ...]
  • for .tar.Z use tar -cvZ[archivename] [pathname ...]
[pathname ...] can be the path of a folder or the path of a list of files you want to compress.

to see the content of an archive, without extracting:
  • for .tar use tar -tvf [archiveName] 
  • for .tar.gz, .tgz  use tar -tvzf [archivefile]
  • for .tar.bz2, .tbz2, .tbz  use tar -tvjf [archivefile]
  • for .tar.Z use tar -tvZf [archivefile}

Nessun commento:

Posta un commento