|
| 1 | +# Usage |
| 2 | + |
| 3 | +```sh |
| 4 | +pdu [OPTIONS] [FILES]... |
| 5 | +``` |
| 6 | + |
| 7 | +## Arguments |
| 8 | + |
| 9 | +* `[FILES]...`: List of files and/or directories. |
| 10 | + |
| 11 | +## Options |
| 12 | + |
| 13 | +<a id="json-input" name="json-input"></a> |
| 14 | +### `--json-input` |
| 15 | + |
| 16 | +Read JSON data from stdin. |
| 17 | + |
| 18 | +<a id="json-output" name="json-output"></a> |
| 19 | +### `--json-output` |
| 20 | + |
| 21 | +Print JSON data instead of an ASCII chart. |
| 22 | + |
| 23 | +<a id="option-b" name="option-b"></a><a id="bytes-format" name="bytes-format"></a> |
| 24 | +### `--bytes-format` |
| 25 | + |
| 26 | +* _Aliases:_ `-b`. |
| 27 | +* _Default:_ `metric`. |
| 28 | +* _Choices:_ |
| 29 | + - `plain`: Display plain number of bytes without units |
| 30 | + - `metric`: Use metric scale, i.e. 1K = 1000B, 1M = 1000K, and so on |
| 31 | + - `binary`: Use binary scale, i.e. 1K = 1024B, 1M = 1024K, and so on |
| 32 | + |
| 33 | +How to display the numbers of bytes. |
| 34 | + |
| 35 | +<a id="option-H" name="option-H"></a><a id="deduplicate-hardlinks" name="deduplicate-hardlinks"></a><a id="detect-links" name="detect-links"></a><a id="dedupe-links" name="dedupe-links"></a> |
| 36 | +### `--deduplicate-hardlinks` |
| 37 | + |
| 38 | +* _Aliases:_ `-H`, `--detect-links`, `--dedupe-links`. |
| 39 | + |
| 40 | +Detect and subtract the sizes of hardlinks from their parent directory totals. |
| 41 | + |
| 42 | +<a id="top-down" name="top-down"></a> |
| 43 | +### `--top-down` |
| 44 | + |
| 45 | +Print the tree top-down instead of bottom-up. |
| 46 | + |
| 47 | +<a id="align-right" name="align-right"></a> |
| 48 | +### `--align-right` |
| 49 | + |
| 50 | +Set the root of the bars to the right. |
| 51 | + |
| 52 | +<a id="option-q" name="option-q"></a><a id="quantity" name="quantity"></a> |
| 53 | +### `--quantity` |
| 54 | + |
| 55 | +* _Aliases:_ `-q`. |
| 56 | +* _Default:_ `block-size`. |
| 57 | +* _Choices:_ |
| 58 | + - `apparent-size`: Measure apparent sizes |
| 59 | + - `block-size`: Measure block sizes (block-count * 512B) |
| 60 | + - `block-count`: Count numbers of blocks |
| 61 | + |
| 62 | +Aspect of the files/directories to be measured. |
| 63 | + |
| 64 | +<a id="option-d" name="option-d"></a><a id="max-depth" name="max-depth"></a><a id="depth" name="depth"></a> |
| 65 | +### `--max-depth` |
| 66 | + |
| 67 | +* _Aliases:_ `-d`, `--depth`. |
| 68 | +* _Default:_ `10`. |
| 69 | + |
| 70 | +Maximum depth to display the data. Could be either "inf" or a positive integer. |
| 71 | + |
| 72 | +<a id="option-w" name="option-w"></a><a id="total-width" name="total-width"></a><a id="width" name="width"></a> |
| 73 | +### `--total-width` |
| 74 | + |
| 75 | +* _Aliases:_ `-w`, `--width`. |
| 76 | + |
| 77 | +Width of the visualization. |
| 78 | + |
| 79 | +<a id="column-width" name="column-width"></a> |
| 80 | +### `--column-width` |
| 81 | + |
| 82 | +Maximum widths of the tree column and width of the bar column. |
| 83 | + |
| 84 | +<a id="option-m" name="option-m"></a><a id="min-ratio" name="min-ratio"></a> |
| 85 | +### `--min-ratio` |
| 86 | + |
| 87 | +* _Aliases:_ `-m`. |
| 88 | +* _Default:_ `0.01`. |
| 89 | + |
| 90 | +Minimal size proportion required to appear. |
| 91 | + |
| 92 | +<a id="no-sort" name="no-sort"></a> |
| 93 | +### `--no-sort` |
| 94 | + |
| 95 | +Do not sort the branches in the tree. |
| 96 | + |
| 97 | +<a id="option-s" name="option-s"></a><a id="silent-errors" name="silent-errors"></a><a id="no-errors" name="no-errors"></a> |
| 98 | +### `--silent-errors` |
| 99 | + |
| 100 | +* _Aliases:_ `-s`, `--no-errors`. |
| 101 | + |
| 102 | +Prevent filesystem error messages from appearing in stderr. |
| 103 | + |
| 104 | +<a id="option-p" name="option-p"></a><a id="progress" name="progress"></a> |
| 105 | +### `--progress` |
| 106 | + |
| 107 | +* _Aliases:_ `-p`. |
| 108 | + |
| 109 | +Report progress being made at the expense of performance. |
| 110 | + |
| 111 | +<a id="threads" name="threads"></a> |
| 112 | +### `--threads` |
| 113 | + |
| 114 | +* _Default:_ `auto`. |
| 115 | + |
| 116 | +Set the maximum number of threads to spawn. Could be either "auto", "max", or a positive integer. |
| 117 | + |
| 118 | +<a id="omit-json-shared-details" name="omit-json-shared-details"></a> |
| 119 | +### `--omit-json-shared-details` |
| 120 | + |
| 121 | +Do not output `.shared.details` in the JSON output. |
| 122 | + |
| 123 | +<a id="omit-json-shared-summary" name="omit-json-shared-summary"></a> |
| 124 | +### `--omit-json-shared-summary` |
| 125 | + |
| 126 | +Do not output `.shared.summary` in the JSON output. |
| 127 | + |
| 128 | +<a id="option-h" name="option-h"></a><a id="help" name="help"></a> |
| 129 | +### `--help` |
| 130 | + |
| 131 | +* _Aliases:_ `-h`. |
| 132 | + |
| 133 | +Print help. |
| 134 | + |
| 135 | +<a id="option-V" name="option-V"></a><a id="version" name="version"></a> |
| 136 | +### `--version` |
| 137 | + |
| 138 | +* _Aliases:_ `-V`. |
| 139 | + |
| 140 | +Print version. |
| 141 | + |
| 142 | +## Examples |
| 143 | + |
| 144 | +### Show disk usage chart of current working directory |
| 145 | + |
| 146 | +```sh |
| 147 | +pdu |
| 148 | +``` |
| 149 | + |
| 150 | +### Show disk usage chart of a single file or directory |
| 151 | + |
| 152 | +```sh |
| 153 | +pdu path/to/file/or/directory |
| 154 | +``` |
| 155 | + |
| 156 | +### Compare disk usages of multiple files and/or directories |
| 157 | + |
| 158 | +```sh |
| 159 | +pdu file.txt dir/ |
| 160 | +``` |
| 161 | + |
| 162 | +### Show chart in apparent sizes instead of block sizes |
| 163 | + |
| 164 | +```sh |
| 165 | +pdu --quantity=apparent-size |
| 166 | +``` |
| 167 | + |
| 168 | +### Detect and subtract the sizes of hardlinks from their parent nodes |
| 169 | + |
| 170 | +```sh |
| 171 | +pdu --deduplicate-hardlinks |
| 172 | +``` |
| 173 | + |
| 174 | +### Show sizes in plain numbers instead of metric units |
| 175 | + |
| 176 | +```sh |
| 177 | +pdu --bytes-format=plain |
| 178 | +``` |
| 179 | + |
| 180 | +### Show sizes in base 2¹⁰ units (binary) instead of base 10³ units (metric) |
| 181 | + |
| 182 | +```sh |
| 183 | +pdu --bytes-format=binary |
| 184 | +``` |
| 185 | + |
| 186 | +### Show disk usage chart of all entries regardless of size |
| 187 | + |
| 188 | +```sh |
| 189 | +pdu --min-ratio=0 |
| 190 | +``` |
| 191 | + |
| 192 | +### Only show disk usage chart of entries whose size is at least 5% of total |
| 193 | + |
| 194 | +```sh |
| 195 | +pdu --min-ratio=0.05 |
| 196 | +``` |
| 197 | + |
| 198 | +### Show disk usage data as JSON instead of chart |
| 199 | + |
| 200 | +```sh |
| 201 | +pdu --min-ratio=0 --max-depth=inf --json-output | jq |
| 202 | +``` |
| 203 | + |
| 204 | +### Visualize existing JSON representation of disk usage data |
| 205 | + |
| 206 | +```sh |
| 207 | +pdu --json-input < disk-usage.json |
| 208 | +``` |
0 commit comments