home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1987 / 04 / search.doc < prev   
Text File  |  1987-07-30  |  3KB  |  58 lines

  1.           SEARCH                              Michael J. Mefford
  2.           Command                                     1987/No. 4
  3.  
  4.           ______________________________________________________
  5.  
  6.           Purpose:  Searches all or specified directories on a
  7.                     disk for either designated filenames or the
  8.                     first occurrence of character strings within
  9.                     files.
  10.  
  11.           Format:   SEARCH [filespec] [string][/P][/C][/B]
  12.  
  13.           Remarks:  SEARCH defaults to a diskwide search of all
  14.                     subdirectories on the current disk.  You can
  15.                     specify a different drive and/or a pathname
  16.                     as part of the optional filespec parameter.
  17.                     Filename searches support the DOS * and ?
  18.                     wildcards.  Character strings within files
  19.                     are identified by putting them in quotation
  20.                     marks.  (The strings may themselves include a
  21.                     pair of quotation marks.)  Pressing either
  22.                     Ctrl-Break or Ctrl-C terminates SEARCH
  23.                     manually.
  24.  
  25.                     To redirect the output of the SEARCH command
  26.                     to a printer, add /P to the command line, as
  27.                     shown in the first example below.  Adding a
  28.                     similar /C switch will make the search for a
  29.                     character string case-sensitive.
  30.  
  31.                     When searching for a character string, SEARCH
  32.                     normally ignores .COM and .EXE files.  While
  33.                     this saves time, there may be occasions when
  34.                     you want to find copyright notices, error
  35.                     messages, et al. in an executable file.  To
  36.                     include binary files in the search, add the
  37.                     /B parameter on the command line.
  38.  
  39.           Example:  To print out a list all the .COM files in the
  40.                     \PROG subdirectory of your current drive, you
  41.                     would enter
  42.  
  43.                     SEARCH \PROG\*.COM/P
  44.  
  45.           Example:  To find which of the file(s) in your \LETTERS
  46.                     subdirectory contained the salutation, Dear
  47.                     Miss Jones, enter
  48.  
  49.                     SEARCH \LETTERS "Dear Miss Jones"
  50.  
  51.                     Notes:
  52.  
  53.                     1.   SEARCH returns a line number, based on
  54.                          the number of previous carriage returns
  55.                          in the file, when it finds a string.  It
  56.                          reports only the first occurrence of the
  57.                          string in each file.
  58.