


     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



     Name
          LS - Displays directory contents

     Syntax
          ls [ -1abdlmptuxz/.!?h ] [ wildspec ][ :drivespec ]...
          [>[>] file | device ] [ ; next command ]

     Description
          Ls lists the files on the specified drives.  If a wildspec
          is specified, all files that match the wildspec will be
          displayed.  If a drivespec is specified, only files on that
          particular drive or drives will be displayed.  If the
          drivespec is omitted, all directories on all active drives
          are displayed.

          By default, the files are displayed in columns and are
          sorted alphabetically.  Specifying options can cause
          additional information to be displayed, alter the sorting
          order, or change the format of the display.

          Ls accepts several options.  Options are specified by single
          characters, and they may be entered in upper or lowercase.
          Options are always preceded by a hyphen (a "-").  If you are
          specifying multiple options, you can specify the options in
          any of these formats:
                -a -b -c   or   -abc   or   -a -bc   or  -ab -c

          The options are:

          -1   Only one file is listed on each line.  This is useful
               for building lists of files that will be used by other
               programs.

          -a   "All Files".  Files that are marked "invisible" will be
               displayed along with the rest of the files.

          -b   Sorts the files in reverse (Backwards) order.  By
               default the file named "A" (or the file with the most
               recent date) would be displayed first.

          -d   The logical drive number is appended to each filename
               displayed.

          -l   Each file is displayed in a long format, showing the
               size, date and permissions.  This option provides
               information similar to that found in the system DIR (A)
               command.








     Page 1                                             May 15th, 1993






     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



               In the long format, a list of attributes are displayed
               for each file.  These are represented by the characters
               dsifocun.   If the file has a particular attribute, the
               letter is displayed.  If the file doesn't have that
               attribute, a "-" is displayed instead.

               d     The file is a PDS (Partition Data Set) or a
                     DiskDisk subdirectory.
               s     The file is a system file, usually part of the
                     operating system.
               i     The file is marked invisible and is displayed
                     only if the -a option is specified.
               f     The file has a fixed size.
               o     The file is marked "open".  If the OS is running
                     in networked mode, files are marked this way so
                     that only one application can have write access
                     at a time.
               c     The file is copy-protected.
               u     The file has an user-password (only on pre-LS-DOS
                     6.3 and pre-LDOS 5.3 versions).
               n     The file has been modified since the last time
                     backup(L) made a copy of this file.

               The protection attribute for each file is also listed.
               Normally it is Full, but if the file has an Owner
               Password, it can be any of the following:

               Full      The file has no restrictions on access.
               Remove    The file attributes cannot be changed but all
                         other access is allowed.
               Rename    The file cannot removed, but all other access
                         is allowed.
               Write     The file can be read or written but not
                         removed or renamed.
               Update    The file can be read and updated, but cannot
                         be removed, renamed or change size.
               Read      The file can be read or executed, but no
                         other access is allowed.
               Execute   The file can be executed, but cannot be read
                         or modified.
               None      Without the Owner Password, the file cannot
                         be accessed.

               If a file is accessed with the Owner Password, full
               access is always allowed.  On older TRSDOS and LDOS
               versions, if the file has a User Password and an Owner
               Password, no access is allowed at all unless one of the
               two passwords are known.


          -m   Files are displayed in the stream format, separated by
               commas.  (Ignored if -l or -x is specified.)



     Page 2                                             May 15th, 1993






     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



          -p   Output of ls is routed through the more(U1) utility.
               The screen will pause once 23 lines of text have been
               displayed.  The more(U1) prompt ("--More--") allows you
               to advance or search through the remainder of the
               output.  See the more(U1) command for additional
               information on the options that more(U1) provides.  The
               -p option is ignored if the output is redirected.

          -t   Files are sorted by time and date instead of by name.

          -u   Filenames are displayed in uppercase.  By default they
               are displayed in lowercase.

          -x   Files are displayed in columns and are sorted
               horizontally instead of vertically (the default).
               (This option is ignored if -l is specified.)

          -z   In the -l format, the file times are displayed in
               military hours instead of the AM/PM format.

          -/ or -.
               Forces the filenames to be displayed with "/" or "." as
               the extension character.

          -!   Causes ls to ignore any default settings that are
               specified in the DEFAULTS/MAD file.  Ls will also
               ignore any options that are specified to the left of
               the -! option.  Note that the DEFAULTS/MAD file is
               accessed even if the -! option is specified.

          -? or -h
               Displays the help message.

          wildspec
               A wildspec specifies none or more files that are to be
               displayed in alphabetical order.  A wildspec may
               contain none or more of the following wildcard
               characters:

               *     The * matches zero or more characters in the
                     specified position.  For example, the wildspec
                     A*Z will match any of the following filenames:
                                      AZ          ABZ
                                    ABCDEFGZ    ABC/XYZ
                     Note that unlike a LS-DOS/TRSDOS 6 partspec(L),
                     the filename and extension are treated as a
                     single unit.  A single * will match files with
                     and without extensions.







     Page 3                                             May 15th, 1993






     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



               %     The % matches exactly one character.  So A%C
                     matches:
                                      ABC         AXC
                     The file AC will not match the A%C pattern.

               [ ]   Ranges specify multiple characters that may
                     appear in a given position in the filenames being
                     tested.  There are two formats that can be
                     combined:
                     [abc]     These specific characters are
                               acceptable in this position in the
                               filename.  So A[BC5]D would match:
                               ABD            ACD                 A5D
                     [b-e]     The characters in this ASCII range are
                               acceptable in this position in the
                               filename.  A[E-J]X matches:
                               AEX            AFX                 AGX
                               AHX            AIX                 AJX
                               Numbers can also be included in ranges,
                               but the first value of the range must
                               always have a lower ASCII value than
                               the second value.
                     [!...]    The ! excludes all files that match
                               characters in this position.  So
                               A[!DKP]D will match all filenames that
                               start with an "A", end with a "D", and
                               the second character is any character
                               except "D", "K", or "P".

                     Combinations of ranges are also allowed.
                     A[1-3ABD]X would allow these filenames:
                                A1X         A2X         A3X
                                AAX         ABX         ADX

               Any lowercase characters in the wildspec are converted
               to uppercase before the comparison is performed.


          :drivespec
               The drivespec specifies one or more logical drives that
               should be scanned for files that match the file
               wildspec.  The % and * will examine all enabled drives.
               A range can also be used.  For example, :[2-47] will
               search for files on drives 2, 3, 4 and 7.

               If the drivespec is not specified and a wildspec is,
               all drives are searched for files that match the file
               wildspec and all files that match will be displayed.
               So if the command ls sample/txt is used and the file
               SAMPLE/TXT exists on four different logical drives, all
               four files will be displayed.




     Page 4                                             May 15th, 1993






     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



          >[>] file | device
               By specifying a file or device, the output is sent to
               the specified file or device instead of the display.
               This is known as redirected output.  For example, the
               command ls a*:5 > adir:0 places a list of files from
               logical drive 5 with names that start with the letter
               'a' in the file ADIR:0.  If >> is used, ls will append
               the output of ls to the existing contents of the
               specified file or device.  Filespecs for redirection
               may not specify a password.


          ; next command
               After ls completes, the remainder of the command line
               is executed as a second command.  The command ls;date
               will display directory information, and then the date
               will be displayed.


          <SHIFT>@
               When pressed during output to the display, the output
               will pause.  Pressing any other key resumes output.
               Pressing this key is ignored when output is redirected.


     Files
          Ls reads the DEFAULTS/MAD file and uses any default options
          that are specified there.  For example, if you wanted ls to
          always display filenames in uppercase and the times in
          military hours, the following entry in the DEFAULTS/MAD file
          would do this:
                      LS -U -Z
          Options in the DEFAULTS/MAD file are ignored if the -!
          option is specified on the command line.

          You may make copies of ls with different names.  When
          examining the DEFAULTS/MAD file, the name used to invoke the
          program will be used to locate the default entries.  For
          example, if you made copies of LS/CMD and named them
          NDIR/CMD and NCAT/CMD, you could add the following lines to
          the DEFAULTS/MAD file:
                      LS -1
                      NDIR -LP/U
                      NCAT -X/U
          When ndir is run, the output will be similar to what is
          produced by the system dir(L) command, ncat would display
          files in the same order as the system cat(L) command, and
          ls(U1) will display files one per line.







     Page 5                                             May 15th, 1993






     LS(U1)               LS-DOS 6 - Utilities 1                LS(U1)



          If you need more information on ls(U1) or if you want to
          obtain the LDOS 5.3 version, please write to M.A.D.
          Software, P.O. Box 331323, Ft. Worth Texas, 76163.  Please
          include a Self-Addressed-Stamped-Envelope when requesting
          information.
          ------
          305155
















































     Page 6                                             May 15th, 1993



