home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / misc / unixutil.lzh / UNXUTIL.DOC < prev    next >
Text File  |  1985-06-26  |  29KB  |  1,255 lines

  1.  
  2.  
  3.  
  4.                   - 1 -
  5.  
  6.  
  7.  
  8.        ----------------------------------------------------------------
  9.                    NOTES
  10.        ----------------------------------------------------------------
  11.  
  12.          NEW UTILITIES FOR THE OPERATING SYSTEM    DISKS
  13.  
  14.                    FOR MS-DOS 2.0
  15.  
  16.  
  17.        SEARCH       -  uses  powerful  search rules to:     give  directory
  18.               listings,     copy files,  archive files, modify file
  19.               attributes,  sum    file sizes,  and  delete  files.
  20.               Additional options allow you to request prompting,
  21.               recursively  traverse  sub-directories,  and  copy
  22.               entire tree structures.
  23.  
  24.        WC     -    prints the number    of lines and words in each of  a
  25.               list of files.
  26.  
  27.        FGREP     -    searches    through    a list of files    for files  which
  28.               contain  a specific text string.     The line  which
  29.               contains    the text string    and the    file's name  are
  30.               output.    Options    allow searching    sub-directories,
  31.               listing  only file names,     and listing a count  of
  32.               the number of lines which    match.
  33.  
  34.        MV     -    move a file or list of files.  This can copy files
  35.               from  one    directory to another,  perform a  rename
  36.               function,      or  copy  a  file  to     another  volume
  37.               (removing    the original).
  38.  
  39.        TAIL     -    prints  the  last    'n' lines of a file or    list  of
  40.               files.
  41.  
  42.        CAT     -    concatenates a list of files and outputs them.
  43.  
  44.        LIST     -    produces    a directory listing (in    various    formats)
  45.               of a file    or list    of files.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  74.  
  75.  
  76.  
  77.  
  78.        SEARCH ---
  79.  
  80.  
  81.        The  SEARCH utility is used to search,  possibly     traversing  any
  82.        subdirectories  and match your specified    files.     Once files  are
  83.        matched,    their directory    entry may be output, they may be copied,
  84.        their  attributes may be    changed,  or they may be  deleted.   The
  85.        basic format of the SEARCH command is:
  86.  
  87.        SEARCH <ms-dos file or directory    names> <matching constraints>
  88.         <actions>
  89.  
  90.        The  <ms-dos  file or directory names> is a list    of one    or  more
  91.        directory and/or    file names (which can include MS-DOS wildcards).
  92.        This  list  specifies  the possible domain on  which  the  SEARCH
  93.        command will operate.  For example, if you specify:
  94.  
  95.        SEARCH a:/ b:/ c:/ <other parameters>
  96.  
  97.        the  SEARCH utility will    search starting    in the root  directories
  98.        on drives a:,  b:, and c: (and only on those drives).  As another
  99.        example,
  100.  
  101.        SEARCH rtc.asm rtc.src tod.asm <other parameters>
  102.  
  103.        the  SEARCH utility will    consider only the three    files  specified
  104.        when  executing the other parameters.   Note that file names  and
  105.        directories  may    be intermixed (allowing    you to specify a  domain
  106.        of some directories, some specific files, etc.).
  107.  
  108.        The  second set of parameters to    SEARCH,     <matching  constraints>
  109.        further    define    which  particular files    in the domain  of  files
  110.        and/or  directories  specified  you  are     interested  in.   These
  111.        options    are each permitted,  but each option is     only  permitted
  112.        once in the command line.   In order for    a file to be acted upon,
  113.        it must meet all    conditions specified in    <matching constraints>.
  114.  
  115.  
  116.        -name <names>       to  perform    further    pattern    matching on  the
  117.                names  of the files specified,  or the  files
  118.                found in the    directories specified.     <names>
  119.                may    be one or more file names.   The  syntax
  120.                for     multiple  file     name  is   file   names
  121.                separated by    exclamation marks (eg, rtc.asm !
  122.                tod.asm  |  tod.obj).
  123.  
  124.                These file names may    have an    extended type of
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  2
  140.  
  141.  
  142.  
  143.  
  144.                wild-card specification.  The standard MS-DOS
  145.                ?   wild-card  function  is    supported.
  146.  
  147.                In  addition     *  is    supported  and    operates
  148.                anywhere in the text    (for example,  in MS-DOS
  149.                *a* is equivalent to    *,  the    first *    pads out
  150.                to  the end of the name;  using *a*    in  this
  151.                syntax matches anything with    an 'a' in it).
  152.  
  153.                Extra switches have been designed to    general
  154.                ize    pattern     matching.   By    using  the  '-.'
  155.                switch,  wild-cards    will also match    the  '.'
  156.                between  the     file name  and     extension  (for
  157.                example,  in     MS-DOS    *.* must be specified to
  158.                match all files; using * with the '-.' switch
  159.                accomplishes    the same thing).   By using  the
  160.                '-/'     switch,  wild-cards will also match the
  161.                '/'    in a pathname (for  example,  in  MS-DOS
  162.                a/*/*.pas would match a/x/y.pas and a/z/w.pas
  163.                but    not a/x/y/z/q/r/x.pas;    using the * with
  164.                the    '-/' switch would also match  the  final
  165.                path.
  166.  
  167.                A  final  type of wild-card is  a  'multiple-
  168.                choice' selection,  by specifying  characters
  169.                in brackets,     the ? wild-card function can be
  170.                constrained    to only    certain    characters  (for
  171.                example, [aeiou]*.asm will match any    filename
  172.                beginning   with   a     vowel    and  having   an
  173.                extension of    'asm.'
  174.  
  175.                Examples of wild cards for -name:
  176.  
  177.                 [bv][tc][1k]FD*.*
  178.                      would match any file with B or V as
  179.                its first character,     T or C    as its second, 1
  180.                or  K as its    third,    and FD as its fourth and
  181.                fifth
  182.  
  183.                 [bx][tc][1k]FD*       -.
  184.                      uses  the switch to match    the  '.'
  185.                between  the     name  and  extension,     and  is
  186.                equivalent to the above example
  187.  
  188.                 *OMF.BAS
  189.                      will match    any file whose name ends
  190.                with    OMF and    extension is BAS
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  3
  206.  
  207.  
  208.  
  209.  
  210.                 ???BASE.??
  211.                      will  match any file whose    name has
  212.                BASE    as its 4th to 7th characters and has a 2
  213.                character extension
  214.  
  215.        -^name <names>       the    files  found must NOT match any     of  the
  216.                names  specified.   See -name,  above  for  a
  217.                description    of  what  the  <names>    can  be.
  218.                Examples:
  219.  
  220.                -^names *.asm
  221.                 will  match any    file which does    not have
  222.                the extension 'asm.'
  223.  
  224.                -^names [bv]*.*
  225.                 will match any file whose name does  not
  226.                begin with a    B or V.
  227.  
  228.                -name *.asm    -^name BT1*.*
  229.                 using both specifications,  the    combined
  230.                patterns   will   match  any     file  with   an
  231.                extension of    'asm' whose name does not  begin
  232.                with    BT1.
  233.  
  234.  
  235.        -fname <names>       the    full path name must not    match any of the
  236.                names specified.   See -name,  above,  for  a
  237.                description of what the <names> can be.   The
  238.                difference  between -fname and -name    is  that
  239.                the     -name    constraint  only  performs   the
  240.                matching  test on the file's    name,  while the
  241.                -fname will perform its test    against    the full
  242.                pathname   for  that     file  (from  the   root
  243.                directory).    For example,
  244.  
  245.                -name a*
  246.                 would match any    file name beginning with
  247.                SRC.     This is also true if -/ is added.
  248.  
  249.                -fname a* -/
  250.                 would match any    pathnamme beginning with
  251.                A,  that is,     all files on the A:  drive.  If
  252.                patterns   are   specified  to   made   drive
  253.                designagors,    remember that the format is d:/,
  254.                example:
  255.  
  256.                 -fname    a:/t* -/ -.   (matches any  file
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  4
  272.  
  273.  
  274.  
  275.  
  276.                beginning with the letter T in the A: drive's
  277.                root     directory,  or    any subdirectory of A:'s
  278.                root    directory whose    name begins with a T).
  279.  
  280.  
  281.        -^fname    <names>       the    full path names    found must not match any
  282.                of the names    specified in <names>.    Refer to
  283.                -names,  -^names,  and  -fnames for    details.
  284.                For example,
  285.  
  286.                -^fname a:/temp/* -/
  287.                 will not match any of the files    in drive
  288.                A:'s    subdirectory temp.
  289.  
  290.  
  291.        -LE <filename>       the    found file's time of creation (date  and
  292.                time)   must     precede  or  be  the  same   as
  293.                "filename"s    time.  (Read "LE" as "less-than-
  294.                or-equal-to".)
  295.  
  296.  
  297.        -LT <filename>       the    found file's time of creation (date  and
  298.                time)  must precede "filename"s  time.  (Read
  299.                "LT"    as "less-than".)
  300.  
  301.  
  302.        -GE <filename>       the    found file's time of creation (date  and
  303.                time)   must     follow     or  be     the   same   as
  304.                "filename"s    time.  (Read  "GE" as  "greater-
  305.                than-or-equal-to".)
  306.  
  307.  
  308.        -GT <filename>       the    found file's time of creation (date  and
  309.                time)  must follow "filename"s  time.   (Read
  310.                "GT"    as "greater-than".)
  311.  
  312.                The    next  four constraints    offer  the  same
  313.                functionality  as  the LE,  LT,  GE,     and  GT
  314.                options,  except only on a date  basis.   The
  315.                preceding  four constraints use both    date and
  316.                time     (the  date is really part of  the  time
  317.                "continuum".)
  318.  
  319.        -LEDATE <filename>  the found file's date must precede or be  the
  320.                same     as  "filename"s date.     (Read    "LE"  as
  321.                "less-than-or-equal-to".)
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  5
  338.  
  339.  
  340.  
  341.  
  342.        -LTDATE <filename>  the      found      file's   date      must     precede
  343.                "filename"s    date.     (Read    "LT"  as  "less-
  344.                than".)
  345.  
  346.  
  347.        -GEDATE <filename>  the    found file's date must follow or be  the
  348.                same     as  "filename"s date.     (Read    "GE"  as
  349.                "greater-than-or-equal-to".)
  350.  
  351.  
  352.        -GTDATE <filename>  the found file's date must follow "filename"s
  353.                date.  (Read    "GT" as    "greater-than".)
  354.  
  355.  
  356.                Note:  using    search with -GE    (or -GEDATE) and
  357.                -LE    (or -LEDATE) will match    only those files
  358.                with     exactly  the  same  creation  time  (or
  359.                date).
  360.  
  361.  
  362.        -exists <pathname>  the    file found will    match this if a    file  of
  363.                that     same name is also present at  the  path
  364.                specified.  The path    is computed as explained
  365.                in -comp, below.
  366.  
  367.  
  368.        -^exists    <pathname> the    file found will    match this only    if there
  369.                is  not a file of that same name  present  at
  370.                the path specified.     The path is computed as
  371.                explained in    -comp, below.
  372.  
  373.  
  374.        -size <bytes>       the    file found will    match this only    if it is
  375.                at  least  the number of bytes  specified  in
  376.                size.
  377.  
  378.  
  379.        -sizeb <blocks>       the file found will match this only if it  is
  380.                at  least  the  number of  (512-byte)  blocks
  381.                specified in    size.
  382.  
  383.  
  384.        -attr <attr exp>       the    file  found  will  match  this    if  it's
  385.                attributes  make  the  attribute   expression
  386.                specified  true.   The expression consists of
  387.                ANDs,  ORs, NOTs, and letters which represent
  388.                attributes.     Use & for AND,     ! for OR, ^ for
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  6
  404.  
  405.  
  406.  
  407.  
  408.                unary  NOT,    parentheses  for  grouping  sub-
  409.                expressions,      and  the  following  attribute
  410.                letters:
  411.  
  412.                 a    for the archive bit being on
  413.                 d    for the directory bit being on
  414.                 h    for the file being    hidden
  415.                 r    for the file being    read-only
  416.                 s    the for file being    a system file
  417.  
  418.                For example:
  419.  
  420.                -attr a&^r
  421.                 would  match any file whose archive  bit
  422.                is  on  (has     been  changed    since  the  last
  423.                archive)  which is not read-only (can ever be
  424.                changed).
  425.  
  426.  
  427.        -comp <pathname>       the    file  found will match this  pattern  if
  428.                there is a file of the same name as the  file
  429.                found in the    specified path AND the two files
  430.                are equivalent.   Any differences between the
  431.                two files are displayed.
  432.  
  433.                The     -t  switch  preserves    directory   tree
  434.                structure.    If SEARCH A: -COMP Z found a:/x/y,
  435.                the file a:/x/y would be compared to    a:/x/z/y
  436.                instead  of a:/z/y.     The target pathname for
  437.                the compare is computed as follows:
  438.  
  439.                1.    The  drive  prefix,  and any ./     or  ../
  440.                prefixes are    deleted    from the pathname of the
  441.                file    found.
  442.  
  443.                2.    The remainder of the pathname (up to the
  444.                filename) is    appended to the    destination path
  445.                after the -COMP to produce the file which  is
  446.                to be compared.
  447.  
  448.  
  449.        -^comp <pathname>   the    file  found will match this  pattern  if
  450.                there  is not a file    of the same name as  the
  451.                file     found in the specified    path OR    the  two
  452.                files  are not equivalent.    Any  differences
  453.                between  the    two files are displayed.   See -
  454.                COMP, above.
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  7
  470.  
  471.  
  472.  
  473.  
  474.        The  third set of parameters to SEARCH are the  <actions>s.   These
  475.        options    specify     what function is to be    performed on  the  files
  476.        which match the constraints specified.  Actions allow setting and
  477.        resetting of file  attributes;  moving,    copying,  deleting,  and
  478.        backing up files;  printing directory entries; and summing files'
  479.        sizes.
  480.  
  481.        The  following are the switch settings for actions.   Any  action
  482.        marked with an asterisk may be specified    at most    once.
  483.  
  484.  
  485.        -attr+ <attrs>       turns  on the specified attributes.     Specify
  486.                <attrs>  as single-character     attributes,  as
  487.                above.  For example,
  488.  
  489.                -attr+ ar
  490.                      would set the archive and read-only
  491.                bits.
  492.  
  493.  
  494.        -attr- <attrs>       turns  off  the  specified  attributes.   See
  495.                above for details.
  496.  
  497.  
  498.        -mv <pathname>    *  moves  the  files found  into  the  specified
  499.                pathname.  If the -t    option is specified, the
  500.                tree      structure   of  the  source  file   is
  501.                preserved.    For example,  if SEARCH     A:  finds
  502.                a:/x/y, and -MV Z were specified, z/x/y would
  503.                be created, rather than z/y.     The destination
  504.                pathname  is    formed from the    source    pathname
  505.                as follows:
  506.  
  507.                1.    The  drive  prefix and any ./ or ../  is
  508.                removed from    the source pathname.
  509.  
  510.                2.    The remainder of the source pathname  is
  511.                apopended  to the destination path after  the
  512.                specified -mv pathname.
  513.  
  514.  
  515.        -cp <pathname>    *  copies  the    files found into  the  specified
  516.                pathname.   The  -t    option (see above)  also
  517.                applies.   This cannot be used in conjunction
  518.                with    a -backup option.
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  8
  536.  
  537.  
  538.  
  539.  
  540.        -backup <pathname>  *   this  is    a useful function  which  is  an
  541.                abbreviation    for
  542.  
  543.                 -cp <pathname> -attr a -attr- a
  544.  
  545.                That    is, it finds archivable    files and resets
  546.                the archive bit after the copy.   This cannot
  547.                be used in conjunction with a -cp option.
  548.  
  549.  
  550.        -print           list     the  names  of    the files (this     is  the
  551.                default if no actions are specified).
  552.  
  553.  
  554.        -rm           remove the files found.  If -cp is specified,
  555.                the    copy is    performed prior    to the    removal.
  556.                If -mv is specified,    the -rm    has no effect.
  557.  
  558.  
  559.        -rmdir           remove any empty directories    encountered.  If
  560.                -mv    is specified,  the directory  remove  is
  561.                attempted  after  the files have been  moved.
  562.                This    means that
  563.  
  564.                SEARCH x -mv    b: -rmdir
  565.  
  566.                effectively moves all of x to the b:    disk and
  567.                removes all of sub-directory    x.
  568.  
  569.  
  570.        -ls           list     file directory    entries    in long     format.
  571.                This    displays attribute settings,  file size,
  572.                the file's time and date,  and its full  path
  573.                name.  If an    attribute is not set for a file,
  574.                '-' is printed,  if it is set,  the attribute
  575.                is  printed.      For read-write files,     'w'  is
  576.                printed instead of the '-'.
  577.  
  578.  
  579.        -sum           a   sum  of    the  sizes  of    files  found  is
  580.                displayed.    This  is the exact size     of  the
  581.                data     in  the  files    and  does  not    consider
  582.                allocation units' round-off.
  583.  
  584.  
  585.        -tarc <filename>      *   creates    a  "tape  archive"  file   named
  586.                <filename> containing all files found.   This
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.        SEARCH        UNIX like Utilities    for MS-DOS 2.0       Page-  9
  602.  
  603.  
  604.  
  605.  
  606.                is  useful for creating one large file to  be
  607.                used     as  an     archive.    The  files     may  be
  608.                extracted using the -tarx option below.   For
  609.                example,
  610.  
  611.                SEARCH *.pas    -tarc pasbkup.tar
  612.  
  613.                will      put  all  .PAS  files     into  the  file
  614.                PASBKUP.TAR.
  615.  
  616.  
  617.        -tara <filename>      *  this is the same as  -tarc,  above,  except
  618.                that     the  files  found are    appended  to  an
  619.                existing "tar" file.
  620.  
  621.  
  622.        -tarx <filename>      *  search  the files in "tar"    file <filename>.
  623.                The    only  action that you can  perform  with
  624.                this    option is to -ls,  -print,  -sum, or -cp
  625.                them.   -rm    or -mv options will be    ignored.
  626.                For example,
  627.  
  628.                SEARCH -tarx    pasbkup.tar -ls
  629.                 would list the files in    the above  "tar"
  630.                file
  631.  
  632.  
  633.                SEARCH -tarx    pasbkup.tar -cp    xyz
  634.                 would  copy the    files in the above "tar"
  635.                file    into directory xyz
  636.  
  637.  
  638.        Some additional options also exist which    effect the above actions
  639.        and/or constraints.
  640.  
  641.  
  642.        -nr           no  recursive  searching of    sub-directories.
  643.                SEARCH  will    normall    search    any  directories
  644.                you    specify     and all  sub-direcctories  (and
  645.                their  sub-directories .  .    .).   Using this
  646.                option  limits searches to  only  directories
  647.                specified.
  648.  
  649.  
  650.        -p           prompts (asks yes/no) for -cp,  -mv,     -rm, or
  651.                attribute  settings.      For any  action  which
  652.                would  have a permanent effect,  you    may  use
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.        SEARCH        UNIX like Utilities    for MS-DOS 2.0      Page-     10
  668.  
  669.  
  670.  
  671.  
  672.                this    to verify SEARCH's actions.
  673.  
  674.  
  675.        -t           as explained    above,    is used    to preserve tree
  676.                structure of    directories for    -mv, -cp, -comp,
  677.                -exists, -^exists, and -^comp options.
  678.  
  679.  
  680.        -n           take     no actions,  SEARCH will display what    it
  681.                would have done,  but take no actions.   This
  682.                is    equivalent   to     using    -p  and      always
  683.                responding negatively.
  684.  
  685.  
  686.        -a           short-hand for '-attr a', matching only files
  687.                with    the archive bit    set.
  688.  
  689.  
  690.        -s           be silent (display nothing).
  691.  
  692.  
  693.        -.           allow '.', the file extension separator to be
  694.                wild-carded (see above).
  695.  
  696.  
  697.        -/           allow  '/'  to be wild-carded  (as  explained
  698.                above).
  699.  
  700.  
  701.        Single  letter  options    may  be     grouped  after     a  single   '-'
  702.        (providing  they    do not form one    of the multiple-letter options).
  703.        Multiple-letter options must each have a    '-'.   For example,  you
  704.        may specify -avd, but not -nravd.
  705.  
  706.                      HINTS
  707.  
  708.        1.  SEARCH f: -name *.pas
  709.  
  710.        Does  not  necessarily  SEARCH all files    on  drive  f:  with  the
  711.        extension  .PAS    .   SEARCH  will start at  the    current     working
  712.        directory for drive f:.     To search all of drive    f:,  either do a
  713.        CD / before the above command, or use
  714.  
  715.        SEARCH f:/ -name    *.pas
  716.  
  717.  
  718.        2.  To copy all files that have been modified since the last time you
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.        SEARCH        UNIX like Utilities    for MS-DOS 2.0      Page-     11
  734.  
  735.  
  736.  
  737.  
  738.        did a backup, use
  739.  
  740.        SEARCH <where ever> -backup b:
  741.  
  742.        This  copies  modified files to your b:    drive and  resets  their
  743.        archive bits.  If your archive bits are in an unknown state, use
  744.  
  745.        SEARCH <where ever> -attr- a
  746.  
  747.        to reset    all archive bits.
  748.  
  749.  
  750.        3.  To find all directories on a    drive, use
  751.  
  752.        SEARCH <drive>:/    -attr d
  753.  
  754.  
  755.        4.   Since some commands    are short-hand    abbreviations,    remember
  756.        that there are some restrictions.  For example,
  757.  
  758.        SEARCH a: -backup b: -attr r
  759.  
  760.        is  illegal  because '-backup b:' is an abbreviation for    '-cp  b:
  761.        -attr a     -attr-    a' and only one    -attr is allowed.   You    need  to
  762.        specify
  763.  
  764.        SEARCH a: -cp b:    -attr a&r -attr- a
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.        WC        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  800.  
  801.  
  802.  
  803.  
  804.        WC ---
  805.  
  806.  
  807.        The WC utility counts words and lines in    a file.     Its syntax is:
  808.  
  809.        WC <files or directories> <switches>
  810.  
  811.        The specified files' word/line counts will be output,  along with
  812.        the  total  word/line  counts.     The  files  used  will     be  all
  813.        specified,  and    all contained in any directories  listed.   Note
  814.        that MS-DOS wild-cards may be used.  If no <files or directories>
  815.        are specified, then WC accepts keyboard (or redirected) input.
  816.  
  817.        The switches are    as follows:
  818.  
  819.        -r     to traverse any sub-directories encountered as    well.
  820.  
  821.        -w     to omit the word counts (this will save time).
  822.  
  823.  
  824.        Examples:
  825.  
  826.        WC memo.mem
  827.         would print    the lines and words in the named file
  828.  
  829.        WC *.mem    -w
  830.         would print    the line counts    only for all files found,  and a
  831.        total line count    figure.
  832.  
  833.        WC *.mem    /documents -w
  834.         acts  as  the example above,  but in addition  includes  all
  835.        files in    the directory /documents.
  836.  
  837.        WC *.mem    /documents -w -r
  838.         acts as the    example    immediately above,  but    in addition will
  839.        include    all  files  in sub-directories of /documents  (and  sub-
  840.        directories of them).
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.        FGREP        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  866.  
  867.  
  868.  
  869.  
  870.        FGREP ---
  871.  
  872.  
  873.        The  FGREP utility searches files for particular     text  patterns.
  874.        Each  line on which the pattern is found    is displayed.    The text
  875.        patterns    cannot contain blanks or any wild-cards.  The syntax is:
  876.  
  877.  
  878.        FGREP <options> <pattern> <files    or directories>
  879.  
  880.  
  881.        The values for <options>    are as follows:
  882.  
  883.        -r     recursively   search  sub-directories    of   directories
  884.          specified  in    the list <files     or  directories>.   The
  885.          default  is  to  search  only files in     the  <files  or
  886.          directories>  list  and files in  directories    in  that
  887.          list.
  888.  
  889.        -i     ignore    upper/lower case when matching the <pattern>.
  890.  
  891.        -l     also print line numbers for matching text in files.
  892.  
  893.        -n     only print file names of files    with matching text.
  894.  
  895.        -v     reverse  the test--print all lines except those with  a
  896.          matching text pattern.
  897.  
  898.        -c     only  print a count of    how many lines contain    matching
  899.          text.
  900.  
  901.        -^     Treat the character ^ in the pattern string as    a blank.
  902.          Normally,  the     pattern cannot    contain    a blank     because
  903.          command line arguments    are separated by blanks.  The -^
  904.          option     is provided so    that a blank can effectively  be
  905.          specified in the pattern.  For    example,
  906.  
  907.          fgrep    -^  a^string *.pas
  908.  
  909.          searches  all    files ending in    .pas for the  string  "a
  910.          string".   Without the    -^ option, the string "a^string"
  911.          would be searched for.
  912.  
  913.        The <pattern> parameter is the text string to search  for.   This
  914.        string  is  specified  exactly as you want it to     appear     in  the
  915.        files'  lines  (that is,     it is not surrounded by  quotes).   The
  916.        pattern may contain no blanks, and cannot start with a '-' (which
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.        FGREP        UNIX like Utilities    for MS-DOS 2.0       Page-  2
  932.  
  933.  
  934.  
  935.  
  936.        is used to specify options).
  937.  
  938.        The  <files or directories> parameter is    identical to  SEARCH,  see
  939.        above.    If no files are    given, then FGREP accepts keyboard input
  940.        (or redirected input) to    search.
  941.  
  942.        Examples:
  943.  
  944.        FGREP -i    proc c:/sources    d:/project/*.asm
  945.         will  (ignoring upper/lower    case) print a list of files  and
  946.        their  lines  which  contain the     string     'proc',  files     in  the
  947.        directory  c:/sources,  and  files with an .ASM extension in  the
  948.        d:/project directory will be searched.
  949.  
  950.        FGREP -ri proc c:/sources d:/project/*.asm
  951.         will  act  as  the    above  example,     except     that  any  sub-
  952.        directories  of c:/sources (and their sub-directories) will  also
  953.        participate in the string search.
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.        MV        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  998.  
  999.  
  1000.  
  1001.  
  1002.        MV ---
  1003.  
  1004.  
  1005.        The MV command is used to move file(s).    The syntax for MV is:
  1006.  
  1007.        MV <file1> <file2 or directory>
  1008.  
  1009.        If  the    second parameter is <file2>,  then MV moves  file1  into
  1010.        file2  and  deletes  file1 (if file1 and    file2 are  on  the  same
  1011.        drive,  then file1 is renamed as    file2).     If the    second parameter
  1012.        is a directory,    then file1 is moved into that directory, and the
  1013.        original    file1 is deleted.   The    first parameter    may be an MS-DOS
  1014.        wild-card specification.     In this case, all files matched will be
  1015.        moved (copied and deleted) into the directory specified.
  1016.  
  1017.        MV  will     never move a file onto    itself--an  error  message  will
  1018.        occur and the file will not be deleted.     Also, do not MV a wild-
  1019.        carded  file1 onto a file2.   In    this case,  only the first  file
  1020.        will be moved and an error message will occur.
  1021.  
  1022.        Examples:
  1023.  
  1024.        MV a:/pmate.exe b:/bin
  1025.         moves the pmate program to the binary directory of b:
  1026.  
  1027.        MV *.exe    b:/bin
  1028.         moves all .EXE files to the    binary directory of b:
  1029.  
  1030.        MV memo.mem sept28.mem
  1031.         renames the    file memo.mem as sept28.mem
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.        TAIL        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  1064.  
  1065.  
  1066.  
  1067.  
  1068.        TAIL ---
  1069.  
  1070.  
  1071.        The  TAIL  utility displays the last n lines of specified  files.
  1072.        The syntax is:
  1073.  
  1074.        TAIL -<count> <files or directories>
  1075.  
  1076.        As  above,  <files or directories> specifies a list of  (possibly
  1077.        wild-carded)  files and directories full    of files to be    operated
  1078.        upon.   The  <count> option,  if    not specified,    defaults to  10.
  1079.        Otherwise  you  can specify how many of the last    lines  for  each
  1080.        file  to    be displayed.    The maximum value for <count>  is  about
  1081.        450.   If  a line exceeds 130 characters,  TAIL will truncate it.
  1082.        If  no  <files or directories> is specified,  TAIL will    get  its
  1083.        input from the keyboard (or redirected input).
  1084.  
  1085.        Examples:
  1086.  
  1087.        TAIL -3 *.lst
  1088.         will  list    the  last  3 lines of  ever  file  with     a  .LST
  1089.        extension in the    current    directory.
  1090.  
  1091.        TAIL <input
  1092.         is equivalent to
  1093.        TAIL input
  1094.         and    will list the last 10 lines of the file    INPUT.
  1095.  
  1096.        TAIL -50    /temp
  1097.         will  print     the  last 50 lines of every file in  the  /temp
  1098.        directory.
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.        CAT        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  1130.  
  1131.  
  1132.  
  1133.  
  1134.        CAT ---
  1135.  
  1136.  
  1137.        The CAT utility will concatenate    the files specified and     display
  1138.        their contents.    The syntax is:
  1139.  
  1140.        CAT <files or directories>
  1141.  
  1142.        Where  <files  or  directories> is just like it is in  the  other
  1143.        utilities.  If omitted, input will be taken from    the keyboard (or
  1144.        redirected input).  Examples:
  1145.  
  1146.        CAT *.asm > backup
  1147.         will  take all files with the extension .ASM in the     current
  1148.        directory  and (using output redirection) combine them  into  the
  1149.        file BACKUP.
  1150.  
  1151.        CAT /temp
  1152.         will  display  the    contents  of  all  files  in  the  /TEMP
  1153.        directory.
  1154.  
  1155.        CAT /temp *.plm
  1156.         will  display  the    contents  of  all  files  in  the  /TEMP
  1157.        directory  and  all files with the extension .PLM in the     current
  1158.        directory.
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.        LIST        UNIX like Utilities    for MS-DOS 2.0       Page-  1
  1196.  
  1197.  
  1198.  
  1199.  
  1200.        LIST ---
  1201.  
  1202.  
  1203.        The LIST    utility    lists files in name-only or directory format.  The
  1204.        syntax is:
  1205.  
  1206.        LIST <options> <files or    directories>
  1207.  
  1208.        The options are:
  1209.  
  1210.        -l     list the directory entries (each file name,  the file's
  1211.          attributes, date, time, and size are listed.
  1212.  
  1213.        -r     recursively  list all files in    sub-directories     of  any
  1214.          directory specified.
  1215.  
  1216.        -1     list only one file name per line.
  1217.  
  1218.        -t     sort    output    by  file  date    &  time,   rather   than
  1219.          alphabetically.
  1220.  
  1221.        -b     sort backwards.
  1222.  
  1223.        -g     list  "toGether";  don't  separate  output  on     a  per-
  1224.          directory basis.
  1225.  
  1226.        NOTE:  long-format listings will    NOT be sorted.
  1227.  
  1228.        The  <files or directories> parameter is    as above.   If    omitted,
  1229.        the current directory will be used.  Examples:
  1230.  
  1231.  
  1232.        LIST
  1233.         will  list (in short form) the files and directories in  the
  1234.        present directory.
  1235.  
  1236.        LIST -rl    c:/temp    *.asm
  1237.         will  list    (in  long  format)  the     files    in  the     c:/temp
  1238.        directory  (and its sub-directories),  and any file with    the .ASM
  1239.        extension in the    working    directory.
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.