old-www/LDP/GNU-Linux-Tools-Summary/html/tar.html

235 lines
3.3 KiB
HTML
Raw Permalink Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>tar (tape archiver)</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="GNU/Linux Command-Line Tools Summary"
HREF="index.html"><LINK
REL="UP"
TITLE="Archiving Files"
HREF="backing-up-files.html"><LINK
REL="PREVIOUS"
TITLE="Archiving Files"
HREF="backing-up-files.html"><LINK
REL="NEXT"
TITLE="rsync"
HREF="rsync.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>GNU/Linux Command-Line Tools Summary</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="backing-up-files.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 15. Archiving Files</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="rsync.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="TAR"
></A
>15.1. tar (tape archiver)</H1
><P
>Type <EM
>tar</EM
> then <EM
>-option(s)</EM
></P
><P
>Options list:</P
><P
></P
><UL
><LI
><P
>-c --- create.</P
></LI
><LI
><P
>-v --- verbose, give more output, show what files are being worked with (extracted or added).</P
></LI
><LI
><P
>-f --- file (create or extract from file) - should always be the last option otherwise the command will not work. </P
></LI
><LI
><P
>-z --- put the file though gzip or use gunzip on the file first.</P
></LI
><LI
><P
>-x --- extract the files from the tarball.</P
></LI
><LI
><P
>-p --- preserves dates, permissions of the original files.</P
></LI
><LI
><P
>-j --- send archive through bzip2.</P
></LI
><LI
><P
>--exclude=pattern --- this will stop certain files from being archived (using a standard wild-card pattern) or a single file name.</P
></LI
></UL
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>tar<EFBFBD>examples</DT
><DD
><P
><EFBFBD></P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>tar -cvpf name_of_file.tar files_to_be_backed_up</PRE
></FONT
></TD
></TR
></TABLE
><P
>This would create a tape archive (no compressing).</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>tar -zxvpf my_tar_file.tar.gz</PRE
></FONT
></TD
></TR
></TABLE
><P
>This would extract files (verbosely) from a gzipped tape archive.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="backing-up-files.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="rsync.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Archiving Files</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="backing-up-files.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>rsync</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>