home *** CD-ROM | disk | FTP | other *** search
/ Big Blue Disk 4 / bbd04new.zip / LS.DOC < prev    next >
Text File  |  1986-12-01  |  8KB  |  231 lines

  1. ^1                                The LS Command
  2.                                By Bryan Higgins
  3.  
  4.                                  Version 2.12
  5.                             For MS-DOS 2.0 or later
  6.  
  7.                                   List Files                     
  8.  
  9.  
  10. The LS command is a directory lister, much in the fashion of the LS command in 
  11. UNIX.  It basically performs the function of the DIR command in DOS.  However, 
  12. it has many special features which DIR lacks.  Advantages (admittedly a matter 
  13. of (good) taste) over DIR: 
  14.  
  15.              o Files are listed in alphabetical order by default
  16.              o Default is "wide" (/W in DIR-speak)
  17.              o Default is to omit ".", "..", hidden files, and volume ID
  18.              o Lists day of week (Monday, Tuesday ...)
  19.              o Uses 24-hour time
  20.              o Lists byte-count & directory-count totals
  21.              o Shows file attributes
  22.              o Flags directories
  23.              o Pauses on full screen ("More")
  24.  
  25. Useful options:
  26.  
  27.              o List only files dated after a given date
  28.              o List only files changed since last backup
  29.              o Recursively list sub-directories
  30.              o Show remaining space on drive only
  31.              o Show total file space only
  32.              o Sort by file date & time
  33.              o Sort by file extension
  34.              o Sort by file size
  35.              o Exclude files from listing
  36.              o Feed file list into filter
  37.  
  38. LS is intended for use with a Winchester (hard disk) or RAM disk.  However, it 
  39. will also work with floppy disks.  There is a slight delay on large directories
  40. as LS must read up all directory entries and sort them before displaying the 
  41. first. 
  42.  
  43. Usage:  Type LS, followed by its arguments.  These can include a series of 
  44. option switches, which are letters of the alphabet used to designate special 
  45. features.  A series of switches should begin with the hyphen (-) character. 
  46. The formal syntax of LS is as follows: 
  47.  
  48.              ls [-acdefglmnorstuvxy?] [-w[<date>]] [<file>] ...
  49.  
  50. The square brackets indicate optional arguments.
  51.  
  52. <file>  indicates  a file specification of the form  accepted  by DIR, 
  53. formally: 
  54.  
  55.              [<drive>:][<path>][<name>][.[<ext>]]
  56.  
  57. All components are optional and have the same defaults as DIR.  The <name> and 
  58. <ext> portions may contain wildcard characters. 
  59.  
  60. A plain
  61.  
  62.              ls
  63.  
  64. will  list  all  files in the current directory  (except  hidden files, 
  65. volume ID, ".", and "..") sorted alphabetically, five per line.  The number 
  66. of files matched is always given, along with the total byte count of files  
  67. matched.  Directory names are appended with a backslash. 
  68.  
  69. The options are
  70.  
  71.              -a (All) List  ".",  "..", hidden files, and volume ID if 
  72.                 matched
  73.              -b (But) Inverts the meaning of -c -d -t -y and -w (see 
  74.                 below)
  75.              -c (Changed) Restrict matches to files changed since backup
  76.              -d (Directories) Restrict matches to directories
  77.              -e (Extension) Sort alphabetically on file extension
  78.              -f (Filter) Single-column (filter-ready) listing
  79.              -h (Hugest) Sort by size, largest to smallest
  80.              -l (Long) Long listing: dates, sizes & attributes
  81.              -m (Minisculest) Sort by size, smallest to largest
  82.              -n (Newest) Sort by date & time, newest to oldest
  83.              -o (Oldest) Sort by date & time, oldest to newest
  84.              -r (Recursive) Search subdirectories recursively
  85.              -s (Summary) List only total counts and sizes
  86.              -t (Today) Restrict matches to files dated today
  87.              -u (Unused) Shows space remaining on drive (no files listed)
  88.              -v (Version) Show LS version only
  89.              -w (When) Restrict matches to files dated on or after a 
  90.                 given date, where <date> is one of
  91.  
  92.                        o A full date, e.g. 11/22/85
  93.                        o A day in the current year, e.g. 11/22
  94.                        o A day of the current month, e.g. 22
  95.                 
  96.                 A  missing date restricts matches to files dated  in  the 
  97.                 current week, beginning on Monday
  98.  
  99.              -x (eXcept) Don't list files matching subsequent arguments
  100.              -y (Yesterday) Restrict matches to files dated yesterday or 
  101.                 today
  102.              -? (Huh?) Show command format
  103.  
  104. Options may be combined, e.g.
  105.  
  106.              ls -aln *.c
  107.  
  108. or segregated:
  109.  
  110.              ls -a *.c -ln
  111.  
  112. The -w option should be last (or alone) in a group.
  113.  
  114. The -b option inverts the meaning of -c -d -t -w and -y; thus
  115.  
  116.              ls -bd
  117.  
  118. will list all non-directory files,
  119.  
  120.              ls -bt .exe
  121.  
  122. will list all .EXE files but those dated today, and
  123.  
  124.              ls -bw1/1/85
  125.  
  126. will list all files dated before 1985.
  127.  
  128. The -x option excludes from the listing files matching ALL subsequent arguments
  129. (this is a change from former versions), thus 
  130.  
  131.              ls -x *.c .asm
  132.  
  133. means list all files except .C files and .ASM extensions, and
  134.  
  135.              ls p*.* -x *.exe
  136.  
  137. means list all files beginning with P except .EXE files.
  138.  
  139. In the attributes given in the long (-l) listing, W means read/write, R means 
  140. read-only, H means hidden, S means system file, and A means changed since 
  141. last archive (backup). 
  142.  
  143. Two byte counts are given with -l.  The first is the number of bytes of data 
  144. in the file; the second is the amount of room the file takes up on the disk 
  145. (disk space is allocated in largish fixed-size increments). 
  146.  
  147. The -s option does not list file names, but rather gives a summary of the 
  148. count and total size of the files specified. 
  149.  
  150. The -f option is intended for use with filters; matching files are listed 
  151. one per line, with no heading or summary information.  You may not understand 
  152. the purpose of this option at present, but it will become clearer in future 
  153. months as we present other Kramden utilities which are capable of taking the 
  154. output generated by LS with the -f option, and using it to perform a variety 
  155. of actions on specified lists of files.  For example, you will be able to use 
  156. a combination of Kramden utilities to perform selective or complete backups of 
  157. your files.  Such uses will be documented in future issues of BIG BLUE DISK in 
  158. the documentation for Kramden utilities which can be used in combination in 
  159. such a manner.
  160.  
  161. Only one of the -e, -h, -m, -n, or -o sorting options should be given. 
  162.  
  163. If the screen fills, LS pauses and prompts with
  164.  
  165.              More?
  166.  
  167. An answer of 'N',  'n',  or '^C' will terminate LS; anything else continues. 
  168.  
  169. Examples:
  170.  
  171.              o All ordinary files in current directory
  172.  
  173.                   ls
  174.  
  175.              o All non-directory files
  176.  
  177.                   ls -bd
  178.  
  179.              o Long listing of files LS.*
  180.  
  181.                   ls -l ls
  182.  
  183.              o Long listing of files dated today:
  184.  
  185.                   ls -alt
  186.  
  187.              o Files dated this week
  188.  
  189.                   ls -w
  190.  
  191.              o All .EXE files, newest to oldest:
  192.  
  193.                   ls -n .exe
  194.  
  195.              o All .C files dated on or after November 3, 1984
  196.  
  197.                   ls -w11/3/84 .c
  198.  
  199.              o All files dated this year, oldest to newest
  200.  
  201.                   ls -lw1/1 -o
  202.  
  203.              o All files dated on or after the 3rd of this month
  204.  
  205.                   ls -w3
  206.  
  207.              o All non-.EXE and non-.COM files, sorted by extension
  208.  
  209.                   ls -x .exe .com -e
  210.  
  211.              o Count size and number of .exe files in current directory 
  212.                and below:
  213.  
  214.                   ls -rs .exe
  215.  
  216.              o List all files on current disk not backed up:
  217.  
  218.                   ls -cr \
  219.  
  220.              o Get count and size of all files on current disk not backed 
  221.                up:
  222.  
  223.                   ls -crs \
  224.  
  225.              o List all directories on the disk
  226.  
  227.                   ls -rfd \
  228.  
  229.  
  230.                   Copyright (c) 1985, 1986 by Bryan Higgins.
  231.