File: duc.1.html

package info (click to toggle)
duc 1.4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,336 kB
  • sloc: ansic: 11,732; sh: 215; makefile: 102; xml: 24
file content (866 lines) | stat: -rw-r--r-- 31,131 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
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
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
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
866
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv='content-type' content='text/html;charset=utf8'>
  <meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'>
  <title>duc(1) - index, query and graph disk usage</title>
  <style type='text/css' media='all'>
  /* style: man */
  body#manpage {margin:0}
  .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
  .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
  .mp h2 {margin:10px 0 0 0}
  .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
  .mp h3 {margin:0 0 0 4ex}
  .mp dt {margin:0;clear:left}
  .mp dt.flush {float:left;width:8ex}
  .mp dd {margin:0 0 0 9ex}
  .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
  .mp pre {margin-bottom:20px}
  .mp pre+h2,.mp pre+h3 {margin-top:22px}
  .mp h2+pre,.mp h3+pre {margin-top:5px}
  .mp img {display:block;margin:auto}
  .mp h1.man-title {display:none}
  .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
  .mp h2 {font-size:16px;line-height:1.25}
  .mp h1 {font-size:20px;line-height:2}
  .mp {text-align:justify;background:#fff}
  .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
  .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
  .mp u {text-decoration:underline}
  .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
  .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
  .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
  .mp b.man-ref {font-weight:normal;color:#434241}
  .mp pre {padding:0 4ex}
  .mp pre code {font-weight:normal;color:#434241}
  .mp h2+pre,h3+pre {padding-left:0}
  ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
  ol.man-decor {width:100%}
  ol.man-decor li.tl {text-align:left}
  ol.man-decor li.tc {text-align:center;letter-spacing:4px}
  ol.man-decor li.tr {text-align:right;float:right}
  </style>
  <style type='text/css' media='all'>
  /* style: toc */
  .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
  .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
  .man-navigation a:hover {color:#111;text-decoration:underline}
  </style>
  <style type='text/css' media='all'>
  /* style: 80c */
  .mp {max-width:86ex}
   
  .man-navigation {left:101ex}
  </style>
</head>
<!--
  The following styles are deprecated and will be removed at some point:
  div#man, div#man ol.man, div#man ol.head, div#man ol.man.

  The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
  .man-navigation should be used instead.
-->
<body id='manpage'>
  <div class='mp' id='man'>

  <div class='man-navigation' style='display:none'>
    <a href="#NAME">NAME</a>
    <a href="#SYNOPSIS">SYNOPSIS</a>
    <a href="#DESCRIPTION">DESCRIPTION</a>
    <a href="#USAGE">USAGE</a>
    <a href="#CREATING-THE-INDEX">CREATING THE INDEX</a>
    <a href="#QUERYING-THE-INDEX">QUERYING THE INDEX</a>
    <a href="#OPTIONS">OPTIONS</a>
    <a href="#CGI-INTERFACING">CGI INTERFACING</a>
    <a href="#A-NOTE-ON-FILE-SIZE-AND-DISK-USAGE">A NOTE ON FILE SIZE AND DISK USAGE</a>
    <a href="#BUILDING-FROM-GIT">BUILDING from git</a>
    <a href="#EXAMPLES">EXAMPLES</a>
    <a href="#FREQUENTLY-ASKED-QUESTIONS">FREQUENTLY ASKED QUESTIONS</a>
    <a href="#FILES">FILES</a>
    <a href="#AUTHORS">AUTHORS</a>
    <a href="#LICENSE">LICENSE</a>
  </div>

  <ol class='man-decor man-head man head'>
    <li class='tl'>duc(1)</li>
    <li class='tc'></li>
    <li class='tr'>duc(1)</li>
  </ol>

  

<h2 id="NAME">NAME</h2>
<p class="man-name">
  <code>duc</code> - <span class="man-whatis">index, query and graph disk usage</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>

<p><code>duc</code> <var>subcommand</var> <a href="#OPTIONS" title="OPTIONS" data-bare-link="true">options</a></p>

<h2 id="DESCRIPTION">DESCRIPTION</h2>

<p>Duc is a collection of tools for inspecting and visualizing disk usage.</p>

<p>Duc maintains an indexed database of accumulated sizes of directories of your
file system, and allows you to query this database with some tools, or create
fancy sunburst graphs to show you where your bytes are.</p>

<p>Duc scales quite well, it has been tested on systems with more then 500 million
files and several petabytes of storage.</p>

<h2 id="USAGE">USAGE</h2>

<p>Duc comes with a command line tool called <code>duc</code>, which is used to create,
maintain and query the disk usage database.  run <code>duc help</code> to get a list of
available commands. <code>duc help &lt;subcommand&gt;</code> describes the usage of a specific
subcommand. Run <code>duc help --all</code> for an extensive list of all commands and
their options.</p>

<p>Some commands might not be available on your system, depending on the exact
configuration chosen when building Duc. (For example, the <code>duc gui</code> command is
not available in the <code>duc-nox</code> package on Debian and Ubuntu)</p>

<p>Duc allows any option to be placed either on the command line or in a
configuration file. Options on the command line are preceded by a
double-leading-dash (<code>--option</code>), some options have a corresponding short
option which can be used as well with a single leading dash. (<code>-o</code>)</p>

<p>At startup duc tries to read its configuration from three locations in this
particular order: <code>/etc/ducrc</code>, <code>~/.config/duc/ducrc</code>, <code>~/.ducrc</code> and
<code>./.ducrc</code>.</p>

<p>A configuration file consists of sections and parameters. The section names
correspond to the duc subcommands for which the parameters in that section
apply. A section begins with the name of the section in square brackets and
continues until the next section begins. Sections contain parameters, one per
line, which consist of a single option name for boolean flags, or an option name
and a value for options which take a value. See the EXAMPLES section for an
example of the configuration file format.</p>

<h2 id="CREATING-THE-INDEX">CREATING THE INDEX</h2>

<p>Duc needs an index file of the file system before it is able to show any
information.  To create the index, run the <code>duc index</code> command. For example, to
create an index of your home directory run <code>duc index ~</code></p>

<pre><code>$ duc index /usr
Skipping lost+found: Permission denied
Indexed 333823 files and 48200 directories, (35.0GB total) in 1 seconds
</code></pre>

<p>The default location of the database is <code>$HOME/.duc.db</code>. To use a different
database location, use the DUC_DATABASE environment variable or specify the
database location with the --database argument.</p>

<p>You can run <code>duc index</code> at any time later to rebuild the index.</p>

<p>By default Duc indexes all directories it encounters during file system
traversal, including special file systems like /proc and /sys, and
network file systems like NFS or Samba mounts. There are a few options to
select what parts of your filesystem you want to include or exclude from the
scan, check the documentation below for the options --one-file-system, 
--exclude, --fs-exclude and --fs-include for more details.</p>

<h2 id="QUERYING-THE-INDEX">QUERYING THE INDEX</h2>

<p>Duc has various subcommands for querying or exploring the index: (Note that
depending on your configuration, some of these commands might not be available)</p>

<ul>
  <li>
    <p><code>duc info</code> shows a list of available directory trees in the database, and the time
and date of the last scan.</p>
  </li>
  <li>
    <p><code>duc ls</code> lists all files and directories under the given path on the console.</p>
  </li>
  <li>
    <p><code>duc ui</code> runs a ncurses based console user interface for exploring the file
system usage.</p>
  </li>
  <li>
    <p><code>duc gui</code> starts a graphical (X11) interface representing the file system in
a sunburst graph. Click on a directory to redraw the graph from the
perspective of the selected directory. Click in the center of the graph to go
up one directory in the tree.</p>
  </li>
</ul>

<h2 id="OPTIONS">OPTIONS</h2>

<p>This section list all available subcommands and describes their usage and options.</p>

<h3 id="Global-options">Global options</h3>

<p>These options apply to all Duc subcommands:</p>

<dl>
<dt><code>--debug</code></dt>
<dd>increase verbosity to debug level</dd>
<dt>
<code>-h</code>, <code>--help</code>
</dt>
<dd>show help</dd>
<dt>
<code>-q</code>, <code>--quiet</code>
</dt>
<dd>quiet mode, do not print any warning</dd>
<dt>
<code>-v</code>, <code>--verbose</code>
</dt>
<dd>increase verbosity</dd>
<dt><code>--version</code></dt>
<dd>output version information and exit</dd>
</dl>

<h3 id="duc-help">duc help</h3>

<p>Options for command <code>duc help [options]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--all</code>
</dt>
<dd>show complete help for all commands</dd>
</dl>

<h3 id="duc-index">duc index</h3>

<p>The 'index' subcommand performs a recursive scan of the given paths on the
filesystem and calculates the inclusive size of all directories. The results
are written to the index, and can later be queried by one of the other duc tools.</p>

<p>Options for command <code>duc index [options] PATH ...</code>:</p>

<dl>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>use database file VAL</dd>
<dt>
<code>-e</code>, <code>--exclude=VAL</code>
</dt>
<dd>exclude files matching VAL</dd>
<dt>
<code>-H</code>, <code>--check-hard-links</code>
</dt>
<dd>count hard links only once. if two or more hard links point to the same file, only one of the hard links is displayed and counted</dd>
<dt>
<code>-f</code>, <code>--force</code>
</dt>
<dd>force writing in case of corrupted db</dd>
<dt><code>--fs-exclude=VAL</code></dt>
<dd>exclude file system type VAL during indexing. VAL is a comma separated list of file system types as found in your systems fstab, for example ext3,ext4,dosfs</dd>
<dt><code>--fs-include=VAL</code></dt>
<dd>include file system type VAL during indexing. VAL is a comma separated list of file system types as found in your systems fstab, for example ext3,ext4,dosfs</dd>
<dt><code>--hide-file-names</code></dt>
<dd>hide file names in index (privacy). the names of directories will be preserved, but the names of the individual files will be hidden</dd>
<dt>
<code>-U</code>, <code>--uid=VAL</code>
</dt>
<dd>limit index to only files/dirs owned by uid</dd>
<dt>
<code>-u</code>, <code>--username=VAL</code>
</dt>
<dd>limit index to only files/dirs owned by username</dd>
<dt>
<code>-m</code>, <code>--max-depth=VAL</code>
</dt>
<dd>limit directory names to given depth. when this option is given duc will traverse the complete file system, but will only the first VAL levels of directories in the database to reduce the size of the index</dd>
<dt>
<code>-x</code>, <code>--one-file-system</code>
</dt>
<dd>skip directories on different file systems</dd>
<dt>
<code>-p</code>, <code>--progress</code>
</dt>
<dd>show progress during indexing</dd>
<dt><code>--dry-run</code></dt>
<dd>do not update database, just crawl</dd>
<dt><code>--uncompressed</code></dt>
<dd>do not use compression for database. Duc enables compression if the underlying database supports this. This reduces index size at the cost of slightly longer indexing time</dd>
</dl>

<h3 id="duc-info">duc info</h3>

<p>Options for command <code>duc info [options]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>show apparent instead of actual file size</dd>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
</dl>

<h3 id="duc-ls">duc ls</h3>

<p>The 'ls' subcommand queries the duc database and lists the inclusive size of
all files and directories on the given path. If no path is given the current
working directory is listed.</p>

<p>Options for command <code>duc ls [options] [PATH]...</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>show apparent instead of actual file size</dd>
<dt><code>--ascii</code></dt>
<dd>use ASCII characters instead of UTF-8 to draw tree</dd>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt>
<code>-F</code>, <code>--classify</code>
</dt>
<dd>append file type indicator (one of */) to entries</dd>
<dt>
<code>-c</code>, <code>--color</code>
</dt>
<dd>colorize output (only on ttys)</dd>
<dt><code>--count</code></dt>
<dd>show number of files instead of file size</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt>
<code>-D</code>, <code>--directory</code>
</dt>
<dd>list directory itself, not its contents</dd>
<dt><code>--dirs-only</code></dt>
<dd>list only directories, skip individual files</dd>
<dt><code>--full-path</code></dt>
<dd>show full path instead of tree in recursive view</dd>
<dt>
<code>-g</code>, <code>--graph</code>
</dt>
<dd>draw graph with relative size for each entry</dd>
<dt>
<code>-l</code>, <code>--levels=VAL</code>
</dt>
<dd>traverse up to ARG levels deep [4]</dd>
<dt>
<code>-n</code>, <code>--name-sort</code>
</dt>
<dd>sort output by name instead of by size</dd>
<dt>
<code>-R</code>, <code>--recursive</code>
</dt>
<dd>recursively list subdirectories</dd>
</dl>

<h3 id="duc-xml">duc xml</h3>

<p>Options for command <code>duc xml [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>interpret min_size/-s value as apparent size</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt>
<code>-x</code>, <code>--exclude-files</code>
</dt>
<dd>exclude file from xml output, only include directories</dd>
<dt>
<code>-s</code>, <code>--min_size=VAL</code>
</dt>
<dd>specify min size for files or directories</dd>
</dl>

<h3 id="duc-json">duc json</h3>

<p>Options for command <code>duc json [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>interpret min_size/-s value as apparent size</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt>
<code>-x</code>, <code>--exclude-files</code>
</dt>
<dd>exclude file from json output, only include directories</dd>
<dt>
<code>-s</code>, <code>--min_size=VAL</code>
</dt>
<dd>specify min size for files or directories</dd>
</dl>

<h3 id="duc-graph">duc graph</h3>

<p>The 'graph' subcommand queries the duc database and generates a sunburst graph
showing the disk usage of the given path. If no path is given a graph is created
for the current working directory.</p>

<p>By default the graph is written to the file 'duc.png', which can be overridden by
using the -o/--output option. The output can be sent to stdout by using the special
file name '-'.</p>

<p>Options for command <code>duc graph [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>Show apparent instead of actual file size</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt><code>--count</code></dt>
<dd>show number of files instead of file size</dd>
<dt><code>--dpi=VAL</code></dt>
<dd>set destination resolution in DPI [96.0]</dd>
<dt>
<code>-f</code>, <code>--format=VAL</code>
</dt>
<dd>select output format <var>png|svg|pdf|html</var> [png]</dd>
<dt><code>--fuzz=VAL</code></dt>
<dd>use radius fuzz factor when drawing graph [0.7]</dd>
<dt><code>--gradient</code></dt>
<dd>draw graph with color gradient</dd>
<dt>
<code>-l</code>, <code>--levels=VAL</code>
</dt>
<dd>draw up to ARG levels deep [4]</dd>
<dt>
<code>-o</code>, <code>--output=VAL</code>
</dt>
<dd>output file name [duc.png]</dd>
<dt><code>--palette=VAL</code></dt>
<dd>select palette. available palettes are: size, rainbow, greyscale, monochrome, classic</dd>
<dt><code>--ring-gap=VAL</code></dt>
<dd>leave a gap of VAL pixels between rings</dd>
<dt>
<code>-s</code>, <code>--size=VAL</code>
</dt>
<dd>image size [800]</dd>
</dl>

<h3 id="duc-cgi">duc cgi</h3>

<p>Options for command <code>duc cgi [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>Show apparent instead of actual file size</dd>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt><code>--count</code></dt>
<dd>show number of files instead of file size</dd>
<dt><code>--css-url=VAL</code></dt>
<dd>url of CSS style sheet to use instead of default CSS</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt><code>--dpi=VAL</code></dt>
<dd>set destination resolution in DPI [96.0]</dd>
<dt><code>--footer=VAL</code></dt>
<dd>select HTML file to include as footer</dd>
<dt><code>--fuzz=VAL</code></dt>
<dd>use radius fuzz factor when drawing graph [0.7]</dd>
<dt><code>--gradient</code></dt>
<dd>draw graph with color gradient</dd>
<dt><code>--header=VAL</code></dt>
<dd>select HTML file to include as header</dd>
<dt>
<code>-l</code>, <code>--levels=VAL</code>
</dt>
<dd>draw up to ARG levels deep [4]</dd>
<dt><code>--list</code></dt>
<dd>generate table with file list</dd>
<dt><code>--palette=VAL</code></dt>
<dd>select palette. available palettes are: size, rainbow, greyscale, monochrome, classic</dd>
<dt><code>--ring-gap=VAL</code></dt>
<dd>leave a gap of VAL pixels between rings</dd>
<dt>
<code>-s</code>, <code>--size=VAL</code>
</dt>
<dd>image size [800]</dd>
<dt><code>--tooltip</code></dt>
<dd>enable tooltip when hovering over the graph. enabling the tooltip will cause an asynchronous HTTP request every time the mouse is moved and can greatly increase the HTTP traffic to the web server</dd>
</dl>

<h3 id="duc-gui">duc gui</h3>

<p>The 'gui' subcommand queries the duc database and runs an interactive graphical
utility for exploring the disk usage of the given path. If no path is given the
current working directory is explored.</p>

<p>The following keys can be used to navigate and alter the graph:</p>

<pre><code>+           increase maximum graph depth
-           decrease maximum graph depth
0           Set default graph depth
a           Toggle between apparent and actual disk usage
b           Toggle between exact byte count and abbreviated sizes
c           Toggle between file size and file count
f           toggle graph fuzz
g           toggle graph gradient
p           toggle palettes
backspace   go up one directory
</code></pre>

<p>Options for command <code>duc gui [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>show apparent instead of actual file size</dd>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt><code>--count</code></dt>
<dd>show number of files instead of file size</dd>
<dt><code>--dark</code></dt>
<dd>use dark background color</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt><code>--fuzz=VAL</code></dt>
<dd>use radius fuzz factor when drawing graph</dd>
<dt><code>--gradient</code></dt>
<dd>draw graph with color gradient</dd>
<dt>
<code>-l</code>, <code>--levels=VAL</code>
</dt>
<dd>draw up to VAL levels deep [4]</dd>
<dt><code>--palette=VAL</code></dt>
<dd>select palette. available palettes are: size, rainbow, greyscale, monochrome, classic</dd>
<dt><code>--ring-gap=VAL</code></dt>
<dd>leave a gap of VAL pixels between rings</dd>
</dl>

<h3 id="duc-ui">duc ui</h3>

<p>The 'ui' subcommand queries the duc database and runs an interactive ncurses
utility for exploring the disk usage of the given path. If no path is given the
current working directory is explored.</p>

<p>The following keys can be used to navigate and alter the file system:</p>

<pre><code>up, pgup, j:     move cursor up
down, pgdn, k:   move cursor down
home, 0:         move cursor to top
end, $:          move cursor to bottom
left, backspace: go up to parent directory (..)
right, enter:    descent into selected directory
a:               toggle between actual and apparent disk usage
b:               toggle between exact and abbreviated sizes
c:               Toggle between file size and file count
h:               show help. press 'q' to return to the main screen
n:               toggle sort order between 'size' and 'name'
o:               try to open the file using xdg-open
q, escape:       quit
</code></pre>

<p>Options for command <code>duc ui [options] [PATH]</code>:</p>

<dl>
<dt>
<code>-a</code>, <code>--apparent</code>
</dt>
<dd>show apparent instead of actual file size</dd>
<dt>
<code>-b</code>, <code>--bytes</code>
</dt>
<dd>show file size in exact number of bytes</dd>
<dt><code>--count</code></dt>
<dd>show number of files instead of file size</dd>
<dt>
<code>-d</code>, <code>--database=VAL</code>
</dt>
<dd>select database file to use [~/.duc.db]</dd>
<dt>
<code>-n</code>, <code>--name-sort</code>
</dt>
<dd>sort output by name instead of by size</dd>
<dt><code>--no-color</code></dt>
<dd>do not use colors on terminal output</dd>
</dl>

<h2 id="CGI-INTERFACING">CGI INTERFACING</h2>

<p>The <code>duc</code> binary has support for a rudimentary CGI interface, currently only
tested with apache.  The CGI interface generates a simple HTML page with a list
of indexed directories, and shows a clickable graph for navigating the file
system. If the option <code>--list</code> is given, a list of top sized files/dirs is also
written.</p>

<p>Configuration is done by creating a simple shell script as .cgi in a directory
which is configured for CGI execution by your web server (usually
<code>/usr/lib/cgi-bin</code>). The shell script should simply start duc, and pass the
location of the database to navigate.</p>

<p>An example duc.cgi script would be</p>

<pre><code>#!/bin/sh
/usr/local/bin/duc cgi -d /home/jenny/.duc.db
</code></pre>

<ul>
  <li>Make sure the database file is readable by the user (usually www-data)</li>
  <li>Debugging is best done by inspecting the web server's error log</li>
  <li>Make sure the .cgi script has execute permissions (<code>chmod +x duc.cgi</code>)</li>
</ul>

<p>Some notes:</p>

<ul>
  <li>
    <p>The HTML page is generated with a simple embedded CSS style sheet. If the
style is not to your liking you can provide an external CSS url with the
--css-url option which will then be used instead of the embedded style
definition.</p>
  </li>
  <li>
    <p>Add the option --list to generate a table of top sized files and directories
in the HTML page.</p>
  </li>
  <li>
    <p>The options --header and --footer allow you to insert your own HTML code
before and after the main.</p>
  </li>
</ul>

<p>The current CGI configuration is not very flexible, nor secure. It is not
advised to run the CGI from public reachable web servers, use at your own risk.</p>

<h2 id="A-NOTE-ON-FILE-SIZE-AND-DISK-USAGE">A NOTE ON FILE SIZE AND DISK USAGE</h2>

<p>The concepts of 'file size' and 'disk usage' can be a bit confusing. Files on
disk have an apparent size, which indicates how much bytes are in the file from
the users point of view; this is the size reported by tools like <code>ls -l</code>. The
apparent size can be any number, from 0 bytes up to several TB.  The actual
number of bytes which are used on the filesystem to store the file can differ
from this apparent size for a number of reasons: disks store data in blocks,
which cause files to always take up a multiple of the block size, files can
have holes ('sparse' files), and other technical reasons. This number is always
a multiple of 512, which means that the actual size used for a file is almost
always a bit more then its apparent size.</p>

<p>Duc has two modes for counting file sizes:</p>

<ul>
  <li>
    <p><code>apparent size</code>: this is the size as reported by <code>ls</code>. This number indicates
the file length, which is usually smaller then the actual disk usage.</p>
  </li>
  <li>
    <p><code>actual size</code>: this is the size as reported by <code>du</code> and <code>df</code>. The actual file
size tells you how much disk is actually used by a file, and is always a
multiple of 512 bytes.</p>
  </li>
</ul>

<p>The default mode used by duc is to use the 'actual size'. Most duc commands to
report disk usage (<code>duc ls</code>, <code>duc graph</code>, <code>duc ui</code>, etc) have an option to
change between these two modes (usually the <code>-a</code>), or use the 'a' key to
toggle.</p>

<h2 id="BUILDING-from-git">BUILDING from git</h2>

<p>If you use git clone to pull down the latest release, you will have to
do the following:</p>

<p>git clone https://github.com/zevv/duc<br>
  cd duc<br>
  autoreconf -i</p>

<p>Then you can run the regular</p>

<p>./configure [ options ]<br>
  make</p>

<p>to the regular build of the software.</p>

<p>A note for Redhat and derivates users. The package providing the development file
for lmdb (lmdb-devel) does not include a lmdb.pc pkgconfig file. This could lead to
errors during the configure phase:</p>

<p>checking for LMDB... no<br>
  configure: error: Package requirements (lmdb) were not met:</p>

<p>To avoid the need to call pkg-config, you may set the environment variables        <br>
LMDB_CFLAGS and LMDB_LIBS:</p>

<p>LMDB_CFLAGS=" " LMDB_LIBS=-llmdb ./configure --with-db-backend=lmdb [ options ]</p>

<h2 id="EXAMPLES">EXAMPLES</h2>

<p>Index the /usr directory, writing to the default database location ~/.duc.db:</p>

<pre><code>$ duc index /usr
</code></pre>

<p>List all files and directories under /usr/local, showing relative file sizes
in a graph:</p>

<pre><code>$ duc ls -Fg /usr/local
  4.7G lib/                 [+++++++++++++++++++++++++++++++++++++++++++]
  3.1G share/               [++++++++++++++++++++++++++++               ]
  2.7G src/                 [++++++++++++++++++++++++                   ]
814.9M bin/                 [+++++++                                    ]
196.6M include/             [+                                          ]
 66.6M x86_64-w64-mingw32/  [                                           ]
 59.9M local/               [                                           ]
 38.8M i686-w64-mingw32/    [                                           ]
 20.3M sbin/                [                                           ]
 13.6M lib32/               [                                           ]
 13.3M libx32/              [                                           ]
</code></pre>

<p>or use the -R  options for the tree view:</p>

<pre><code>$ duc ls -RF /etc/logcheck
 24.0K `+- ignore.d.server/
  4.0K  |  `+- hddtemp 
  4.0K  |   |- ntpdate 
  4.0K  |   |- lirc 
  4.0K  |   |- rsyslog 
  4.0K  |   `- libsasl2-modules 
  8.0K  |- ignore.d.workstation/
  4.0K  |   `- lirc 
  8.0K  `- ignore.d.paranoid/
  4.0K      `- lirc 
</code></pre>

<p>Start the graphical interface to explore the file system using sunburst graphs:</p>

<pre><code>$ duc gui /usr
</code></pre>

<p>Generate a graph of /usr/local in .png format:</p>

<pre><code>$ duc graph -o /tmp/usr.png /usr
</code></pre>

<p>The following sample configuration file defines default parameters for the <code>duc
ls</code> and <code>duc ui</code> commands and defines a global option to configure the database
path which is used by all subcommands</p>

<pre><code>[global]
database /var/cache/duc.db
 
[ls]
recursive
classify
color

[ui]
no-color
apparent
</code></pre>

<h2 id="FREQUENTLY-ASKED-QUESTIONS">FREQUENTLY ASKED QUESTIONS</h2>

<ul>
  <li>
    <p>What does the error 'Database version mismatch mean?'</p>

    <p>The layout of the index database sometimes changes when new features are
implemented. When you get this error you have probably upgraded to a newer
version. Just remove the old database file and rebuild the index.</p>
  </li>
  <li>
    <p>Duc crashes with a segmentation fault, is it that buggy?</p>

    <p>By default Duc uses the Tokyocabinet database backend. Tokyocabinet is pretty
fast, stores the database in a single file and has nice compression support
to keep the database small. Unfortunately, it is not always robust and
sometimes chokes on corrupt database files. Try to remove the database
and rebuild the index. If the error persists contact the authors.</p>
  </li>
  <li>
    <p>Some of the Duc subcommands like <code>duc gui</code> are not available on my system?</p>

    <p>Depending on the configuration that was chosen when building Duc, some
options might or might not be available in the <code>duc</code> utility. For example, on
Debian or Ubuntu Duc comes in two flavours: there is a full featured package
called <code>duc</code>, or a package without dependencies on X-windows called
<code>duc-nox</code>, for which the latter lacks the <code>duc gui</code> command.</p>
  </li>
  <li>
    <p><code>duc index</code> is hogging my system and using a lot of CPU and I/O!</p>

    <p>Traversing a file system is hard work - which is the exact reason why Duc
exists in the first place. You can use the default tools to make Duc behave
nice towards other processes on your machine, use something like:</p>

    <p><code>nice 19 ionice -c 3 duc index [options]</code></p>

    <p>This makes <code>duc index</code> run with the lowest CPU and I/O scheduler priorities,
which is nicer to all the other processes on your machine.</p>
  </li>
</ul>

<h2 id="FILES">FILES</h2>

<p>At startup duc tries to read its configuration from three locations in this
particular order: <code>/etc/ducrc</code>, <code>~/.config/duc/ducrc</code>, <code>~/.ducrc</code> and
<code>./.ducrc</code>.</p>

<p>Duc mainains an index of scanned directories, which defaults to ~/.duc.db. All tools
take the -d/--database option to override the database path.</p>

<h2 id="AUTHORS">AUTHORS</h2>

<ul>
  <li>Ico Doornekamp <a href="mailto:duc@zevv.nl" data-bare-link="true">duc@zevv.nl</a>
</li>
  <li>John Stoffel <a href="mailto:john@stoffel.org" data-bare-link="true">john@stoffel.org</a>
</li>
</ul>

<p>Other contributors can be found in the Git log at GitHub.</p>

<h2 id="LICENSE">LICENSE</h2>

<p>Duc is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation;
version 2 dated June, 1991. Duc is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.</p>

  <ol class='man-decor man-foot man foot'>
    <li class='tl'></li>
    <li class='tc'>July 2022</li>
    <li class='tr'>duc(1)</li>
  </ol>

  </div>
</body>
</html>