     _t_a_r  is  a  multi-purpose  Unix program used to archive
(save and, eventually, restore) multiple  files,  compacting
several  individual  source  files into a compact continuous
data stream.  As noted  below,  _t_a_r  is   similar,  in  some
respects,  to the Windows applications _p_k_z_i_p and _W_i_n_Z_i_p, and
-- most importantly for cross-platform purposes at the  ECMC
-- is partially compatible with _W_i_n_Z_i_p.  The medium to which
_t_a_r writes its output can be either
       a peripheral backup device (such as a  digital  data
     DAT  tape  loaded  into  a Linux or SGI DAT drive, or a
     removable disk), or else
      an archive file, which consolidates  many  individual
     source  files  within  a single physical file on a hard
     disk.
At the ECMC, we use _t_a_r (and a local variant  called  _t_a_r_s_f)
for  a  variety of purposes.  The most common of these func
tions include:

1)   archiving files of various types (including soundfiles)
     to  digital  data tapes or to removable disks (e.g. Zip
     or Orb disks or data compact discs)

2)   collecting several Unix files or  soundfiles,  or  even
     all of the files within a directory, into a compact _t_a_r
     archive file, which can be further compressed by  using
     a Unix compression program such as _g_z_i_p or _b_z_i_p_2.

Once  we  have created a _t_a_r archive file, we can do several
things with it:

      Move or copy the _t_a_r file to another directory, or to
     another ECMC or home machine, and then extract its con
     tents. This is generally  quicker  and  more  efficient
     than copying a group of files one at a time.
       Archive one or more of these _t_a_r files to a data DAT
     tape or removable disk, or burn them to a data  compact
     disc.   A  tar  file  will  take  up  less space on the
     archive medium than the original files, and  even  less
     space  if  we  apply compression to the _t_a_r file.  This
     enables us to store more data onto  a  removable  disk,
     DAT tape or data CD.

After  capturing  several  files  into a _t_a_r archive file or
tape, we can delete the original source files if  they  will
not  be needed for some time, in order to conserve hard disk
space and clean up the clutter on our work  space.   We  can
easily  restore  one, a few or all of these individual files
from our _t_a_r archive at any time.

                     ttaarr ccoommmmaanndd lliinneess

_t_a_r is a command line program run in a shell  window.   Com
mand line arguments to _t_a_r consist of

     (1) a flag argument that tells _t_a_r what to do;
     (2)  either  an  output  _s_t_o_r_a_g_e  _d_e_v_i_c_e or else a _f_i_l_e
     _n_a_m_e, which tells _t_a_r where to write its output or find
     its input; and
     (3)  the names of one or more files to be saved, listed
     or restored.

                           ttaarrssff

Remember that on the ECMC Linux and SGI systems your  shells
always have -t-w-o-working directories:

1)   your  current  working UUnniixx directory, where your ASCII
     files are stored; and

2)   your  current  working  ssoouunnddffiillee  directory  (_$_S_F_D_I_R),
     where  your  soundfiles  and  other large music-related
     files (e.g. phase vocoder and _s_m_s analysis  files)  are
     stored

_t_a_r  operates  from  your  current  Unix directory. The ECMC
utility ttaarrssff is identical to _t_a_r in  every  respect  except
that  it runs _t_a_r from your current working _s_o_u_n_d_f_i_l_e direc
tory. Running _t_a_r_s_f instead of _t_a_r is equivalent to the fol
lowing sequence of commands:
       _p_u_s_h_d  _$_S_F_D_I_R (move into your current working sound
     file directory
      run the specified _t_a_r command
      _p_o_p_d (return to your previous directory)
Thus, in all of the _t_a_r command examples that follow,
     => use _t_a_r when you are operating on  ASCII  (or  other
     types  of  small) files in your current Unix directory,
     and use
     => _t_a_r_s_f instead when you are working  with  soundfiles
     and related large files in your $SFDIR

                     BBaassiicc ttaarr ccoommmmaannddss
     +--+
The  +S-G-I+ version  of _t_a_r employs single characters for each
command flag or option, and a complete flag sequence usually
consists  of  two,  three or more of these characters butted
together immediately after the call  to  _t_a_r.  These  tradi
tional  single  character command flags can be used+-w-i-t-h--t-h-e+
GNU/Linux version of _t_a_r as  well.  However,  the  +G-N-U-/-L-i-n-u-x+
version  of  _t_a_r also provides longer, mneomic alternatives,
preceeded by a single or double dash and indicated in [_i_t_a_l_
_i_c_i_z_e_d  square brackets] below, which you can employ instead
if you prefer.  The following summary of basic _t_a_r  commands
will be sufficient for most users:
     cc  _[_-_-_c_r_e_a_t_e_]  Create a new data tape  (overwriting any
     current contents of this tape) or a new  archive  file,
     and write the named files onto it.
     ff   _[_-_-_f_i_l_e_]  Use the argument that follows as the name
     of the output  device  driver  (e.g.  the  driver  that
     controls  the  operation of a tape drive) or else as an
     archive file name.
     rr  _[_-_A  _-_-_a_p_p_e_n_d_]  Read (append) the named  files  onto
     the end of an existing tape or archive file
     uu   _[_-_-_u_p_d_a_t_e_]   Only  append files that are newer than
     the copy in the archive
     tt  _[_-_-_l_i_s_t_] List all of the files contained  in  a  _t_a_r
     tape or archive file.
     xx  _[_-_-_e_x_t_r_a_c_t  _-_-_g_e_t_]  Extract the named files from the
     tape or archive file.
     If no file names are specified, the entire contents  of
     the tape or archive file will be extracted
     vv  _[_-_-_v_e_r_b_o_s_e_] By default _t_a_r does its  work  silently,
     but with this verbose option  it will display the  name
     and size of each file it acts upon.  You will generally
     want to include this flag so you will know what _t_a_r  is
     doing.
+----+
+L-i-n-u-x+systems only (see following discussion):
     zz  _[_-_-_g_z_i_p  _-_-_u_n_g_z_i_p_]  Apply _g_z_i_p compression or uncom
     pression
     II  _[_-_-_b_z_i_p _]  Apply _b_z_i_p_2 compression or uncompression

For more complete information on using either the SGI or the
GNU version of _t_a_r, type
     _m_a_n _t_a_r (SGI or Linux) or
     _i_n_f_o _t_a_r (Linux only).
The _e_c_m_c_h_e_l_p file _t_a_r contains an abbreviated summary, simi
lar to that presented here.

WWoorrkkiinngg wwiitthh ttaarr aarrcchhiivvee ffiilleess

     To capture a group of files into a  _t_a_r  archive  file,
you  must  include the ff flag on your command line, followed
by the name you give to this archive file.  In  naming  this
"tarball"  archive  file,  it is highly recommended that you
include a _._t_a_r filename extension.

(Important note: On Linux -- but not SGI -- systems, it also
is  possible,  and  in  fact generally recommended, to apply
compression or uncompression to of  all  the  commands  that
follow, a procedure discussed in the next section.)

ASCII file example:
      _t_a_r   _c_v_f   _s_c_o_r_e_f_i_l_e_s_._t_a_r   _f_i_l_e_1  _f_i_l_e_2  _f_i_l_e_3  _m_a_r_*
(SGI or Linux)
   Linux alternative:
  _t_a_r   _-_-_c_r_e_a_t_e  _-_-_v_e_r_b_o_s_e  _-_-_f_i_l_e   _s_c_o_r_e_f_i_l_e_s_._t_a_r   _f_i_l_e_1
_f_i_l_e_2  _f_i_l_e_3  _m_a_r_*

Result:  ASCII  files _f_i_l_e_1, _f_i_l_e_2 and _f_i_l_e_3 in your current
working Unix directory, and all files within this  directory
that  begin with the character string _m_a_r, are written to an
archive file called _s_c_o_r_e_f_i_l_e_s_._t_a_r,  also  located  in  your
current Unix working directory.
To list the contents of this archive file, type:
         _t_a_r  _t_v_f  _s_c_o_r_e_f_i_l_e_s_._t_a_r
         or  _t_a_r   _-_-_l_i_s_t  _-_-_v_e_r_b_o_s_e  _-_-_f_i_l_e  _s_c_o_r_e_f_i_l_e_s_._t_a_r
     (Linux only)
Once we see that all of the files have been written success
fully  to  the  archive file, with no error messages, we can
safely delete the original files:
_r_m _f_i_l_e_1  _f_i_l_e_2  _f_i_l_e_3  _m_a_r_*  (be careful with that asterisk!)
     To extract only _f_i_l_e_2 from the archive, type:
         _t_a_r  _x_v_f  _s_c_o_r_e_f_i_l_e_s_._t_a_r  _f_i_l_e_2
          or else
       _t_a_r  _-_-_e_x_t_r_a_c_t _-_-_v_e_r_b_o_s_e _-_-_f_i_l_e _s_c_o_r_e_f_i_l_e_s_._t_a_r  _f_i_l_e_2
     (Linux only)
To  extract -a-l-l-of the individual files within the _t_a_r file,
type:
         _t_a_r   _s_c_o_r_e_f_i_l_e_s_._t_a_r   _x_v_f  or  (Linux  only)   _t_a_r
     _-_-_e_x_t_r_a_c_t _-_-_v_e_r_b_o_s_e _-_-_f_i_l_e  _s_c_o_r_e_f_i_l_e_s_._t_a_r

   Soundfile  example: _t_a_r_s_f  _c_v_f  _m_i_x_e_s_._t_a_r  _*_m_i_x_*  (SGI or
Linux)
   Linux alternative:
 _t_a_r_s_f  _-_-_c_r_e_a_t_e _-_-_v_e_r_b_o_s_e _-_-_f_i_l_e   _m_i_x_e_s_._t_a_r  _*_m_i_x_*

Result: All soundfiles within your current working soundfile
directory  whose names include the character string _m_i_x will
be written to  an  archive  file  named  _m_i_x_e_s_._t_a_r  in  your
$SFDIR.
To list the contents of this archive file, type:
    _t_a_r_s_f  _t_v_f  _m_i_x_f_i_l_e_s_._t_a_r
    or  _t_a_r   _-_-_l_i_s_t  _-_-_v_e_r_b_o_s_e  _-_-_f_i_l_e  _m_i_x_f_i_l_e_s_._t_a_r (Linux
only)
Here again, if this command  lists  all  the  soundfiles  we
believe  should be in this archive, we can delete the origi
nals:
                         _r_m_s_f _*_m_i_x_*
To extract only soundfile _B_m_i_x from this archive, type:
    _t_a_r_s_f  _x_v_f  _m_i_x_f_i_l_e_s_._t_a_r  _B_m_i_x
 or (Linux only)
 _t_a_r_s_f  _-_-_e_x_t_r_a_c_t _-_-_v_e_r_b_o_s_e _-_-_f_i_l_e  _m_i_x_f_i_l_e_s_._t_a_r  _B_m_i_x
To extract -a-l-l-of the soundfiles within the archive, type
    _t_a_r_s_f  _x_v_f _m_i_x_f_i_l_e_s_._t_a_r  or     _t_a_r_s_f  _-_-_e_x_t_r_a_c_t  _-_-_v_e_r_
_b_o_s_e _-_-_f_i_l_e  _m_i_x_f_i_l_e_s_._t_a_r

     Once  we  have  created a tar archive file, and perhaps
compressed it (see below), we might decide  to  move  it  to
another  directory,  or  to archive it to a DAT tape or to a
Zip disk.  Or we could copy this file from one ECMC computer
to another, or to our home system.

     Beware,  however,  of  moving or copying very large tar
files between disks, or between computers, during periods of
heavy system traffic (such as when you or some other user is
playing or mixing soundfiles).  The massive I/O involved  in
such  transfers,  if  frequently interrupted by other system
traffic, can cause sluggish system performance.

     For advanced users: The _t_a_r command also  can  also  be
used  to  copy  several files directly from one directory to
another, without creating a _t_a_r archive file. To  copy  sev
eral  files  from your current working Uix directory to some
other directory (here called _N_E_W_D_I_R), type
  _t_a_r  _c_f  _-  _f_i_l_e_1  _f_i_l_e_2  _f_i_l_e_3  _|  _( _c_d  _~_/_N_E_W_D_I_R _;   _t_a_r
_x_f  _-  _)
(The  GNU/Linux  version  of  _t_a_r may complain with an error
message while performing this command, but it will work.)

                   Last updated July 2001

