home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / DU113.ZIP / DU.TXT < prev   
Encoding:
Text File  |  1992-04-10  |  6.0 KB  |  139 lines

  1.  
  2. 1. Overview.
  3.  
  4.   DU is a small UNIX-like utility to show how much space is occupied by a 
  5. directory tree.
  6.   It can show how much space is occupied by the entire directory tree or by 
  7. any number of filespecs, optionally excluding any number of filespecs, it 
  8. can show the size of every file, just the directory totals, or just the 
  9. grand total.
  10.   Starting with v1.09 DU is supposed to accept the (all too few) Unix-du- 
  11. options.
  12.  
  13.  
  14. 2. Basic syntax.
  15.  
  16.   Arguments may be options, filespecs or directory names.  The directory 
  17. names separate the other arguments into global and local arguments:
  18.  
  19.   du {global arguments} {base directory {local arguments} }
  20.  
  21.   DU searches through each directory for the files specified before the 
  22. first directory name (global arguments) and those between this and the next 
  23. directory name (local).  If no directory name is specified, . (the current 
  24. directory) is used.
  25.   Later options override earlier, eg. a local /0 overrides a global /1.
  26.   If any include filespecs are specified, the directory table will not be 
  27. counted in the directory size.  Exclude filespecs don't matter.
  28.   Both / and \ may be used in paths, and both / and - as switch character.  
  29. DU will generally figure out what you mean.  If it doesn't you'll get an 
  30. error message.
  31.  
  32.  
  33. 3. Command line options.
  34.  
  35.   Option a (du /a or du -a) will list the file sizes as well as the 
  36. directory totals.
  37.   Option d will show DU's interpretation of the arguments.
  38.   Option e will limit the search to files dated earlier than the date 
  39. given.  Example: -e010101, that is, files dated on or before January 1, 
  40. 2001.  The format is DDMMYY in Europe, DDMMYY in the US and YYMMDD in 
  41. Japan; for the rest of the world it should be the same as DIR uses.
  42.   Option h (or ?) will display a short help screen.
  43.   Option i will include the following filespecs; refer to part 4.
  44.   Option l will limit the search to files dated later than the given date; 
  45. see -e.
  46.   Option n will not include subirectories in the directory size.
  47.   Option s will skip the directory totals and display only the sum.  This 
  48. is exactly the same as -0.
  49.   Option w will show the percentage of space wasted due to too-large 
  50. clusters.
  51.   Option z will suppress 0k files and directories.
  52.   Option 0..65535 shows directories down to the specified level.  
  53. Directories deeper are counted but not listed.
  54.   Option x will exclude the following filespecs, refer to part 4.
  55.  
  56.  
  57. 4. Filespecs.
  58.  
  59.   Standard Unix DU always counts all the files.  This version, however, 
  60. allows you to count only some files or all except some files.
  61.   If you don't specify an include filespec, * (which matches everything) 
  62. will be used.
  63.   If you do specify one or more filespecs, only files matching one (or 
  64. more) of the specs are counted.
  65.   You can exclude files as well, and include files again.
  66.   The filespecs aren't limited by the normal brainless DOS rules. * and ? 
  67. work, but match . as well as normal chars.  You can also match a list, like 
  68. [a-cx], which matches a, b, c and x.  Note that it isn't completely Unix- 
  69. ish either.
  70.   I haven't matched the extended 4DOS 4.0 filespecs either; I don't use all 
  71. that, and anyway they don't use the standard Unix metacharacters.
  72.  
  73.  
  74. 5. Examples.
  75.  
  76.   Sorry, you won't find examples of every last option here.  As you can 
  77. see, I use both / and - as switch characters.
  78.  
  79.   du -1 / shows how much each directory subtree takes, counting all the 
  80. directories but showing only those directly below the root.
  81.  
  82.   du -az *asm* -x ?asm.*
  83. displays the size and path of every file whose name contains ASM anywhere 
  84. except in the 2..4 position, and how much space these files occupy in each 
  85. directory.  Empty directories are not shown.  RM.ASM and OBJ2ASM.COM is 
  86. listed, TASM.EXE isn't.
  87.  
  88.   du -zn *.obj
  89. shows how much space is occupied by .obj files in each directory that 
  90. contains at least one (0k directories aren't shown).  .obj files in 
  91. subdirectories aren't counted in the directory size.
  92.  
  93.   du -as *.bak *.bk[!1-9] *.old
  94. shows all the backup files in the directory tree, ie. files with a file 
  95. type of BAK, BK!, BK1, BK2, BK3, BK4, BK5, BK6, BK7, BK8, BK9 or OLD.
  96.  
  97.   du /x *.bak *.bk[!1-9]
  98. shows the directory totals excluding any backup files.
  99.  
  100.   du *gif* -x *gif*.exe /i vgif*
  101. searches for files containing 'gif' anywhere in the name or extension, 
  102. except files containing 'gif' in the name and with an extension of 'exe', 
  103. but including files whose name starts with 'vgif'.  Pretty far-fetched. 
  104.  
  105.   du /s *.zip *.arc *.arj *.a[0-9][0-9] *.lzh *.gif *.jpg *.pcx *.bmp
  106. finds out how much of your precious hard disk is wasted on archives or 
  107. pretty pictures.
  108.  
  109.   du -l010791az | grep -v .*/$
  110. shows the files added or changed since July 1, 1991.  The date format may 
  111. be different for you.  The grep filters away the directories (lines that 
  112. end with a / are thrown away).
  113.  
  114.  
  115. 6. Bugs
  116.  
  117.   The root directory doesn't exist, according do Mess-DOS' own FindFirst 
  118. function.  My workaround is to search for a directory called 'dirname' 
  119. first, and if that doesn't work to search for anything called 
  120. 'dirname\*.*'.  This should work for everything except completely empty 
  121. drives.
  122.   The directory table size is only an estimate, and sometimes too low.
  123.   DU does some checking for cluster sizes, not much.  JOIN, SUBST and many 
  124. networks will fool it; in those cases it assumes either 1k or the cluster 
  125. size of the default drive.
  126.   The 'wasted space' percentage is incorrect on Stacker volumes, as Stacker 
  127. will use the 'wasted' space for something.
  128.   DU often says that more space is wasted that Norton FS does.  This is 
  129. because DU counts the directory table as well as the files.
  130.   You can't start filespecs with / or -, to avoid clashes with options and 
  131. base directories.
  132.   DU may crash when used on network drives with very deep directory trees; 
  133. some networks don't allow the argument to the DOS FindFirst function to be 
  134. long enough to specify the longest actual path.
  135.  
  136.  
  137.   If you have any questions or comments, my preferred email address is  
  138. arnt@swix.ifi.unit.no.
  139.