Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Extracting archive files in Linux

Tech Computer Center logo

Linux archive files, called “tarballs”, are usually given names ending in “.tgz” or “.tar.gz”.

Assuming you have made an archive using the procedure described in `Making archive files in Linux', follow this procedure to extract some or all of the files.

This procedure will silently overwrite any existing file with the same name. Be careful you don't replace a newer file with an older version.
  1. Move the tarball to the directory under which you want the extract files to live, and cd to that directory.
  2. To copy the files from an archive archname.tgz to their paths relative to that directory:
    tar -xvzf archname.tgz [file...]
    
    If you want to copy only certain files, append their names at the end of the command; otherwise all the files will be extracted from the tarball.

See also: File transfer: moving files to or from the TCC
Previous: Making archive files in Linux
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman, tcc-doc@nmt.edu
Last updated: 2008/01/21 06:58:58 UT
URL: http://www.nmt.edu/tcc/help/xfer/linux-extract.html
QR two-dimensional bar code