Skip to content

Conversation

@ranuzz
Copy link
Owner

@ranuzz ranuzz commented Dec 27, 2021

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Implements a version of du command. It covers most of the relevant options from the original du and the output is a bit customized keeping the dvc use case in mind.

 dvc du --help
usage: dvc du [-h] [-q | -v] [-H] [-d [<integer>]] [-c] [-a] [-s] [--rev [<commit>]] [--json] url [path]

Summarize disk usage of the set of FILEs, recursively for directories tracked by DVC and by Git.
Documentation: <https://man.dvc.org/du>

positional arguments:
  url                   Location of DVC repository
  path                  Path to directory within the repository to list outputs for

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           Be quiet.
  -v, --verbose         Be verbose.
  -H, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -d [<integer>], --max-depth [<integer>]
                        print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument; --max-depth=0 is the same as --summarize
  -c, --total           produce a grand total
  -a, --all             write counts for all files, not just directories
  -s, --summarize       display only a total for each argument
  --rev [<commit>]      Git revision (e.g. SHA, branch, tag)
  --json, --show-json   Show output in JSON format.

Example:

dvc du https://github.com/iterative/dataset-registry use-cases/cats-dogs -H
59.72 G          /use-cases/cats-dogs/data/train/dogs
59.72 G          /use-cases/cats-dogs/data/train/cats
119.45 G         /use-cases/cats-dogs/data/train
23.89 G          /use-cases/cats-dogs/data/validation/dogs
23.89 G          /use-cases/cats-dogs/data/validation/cats
47.78 G          /use-cases/cats-dogs/data/validation
167.23 G         /use-cases/cats-dogs/data
167.23 G         /use-cases/cats-dogs

@efiop efiop removed their request for review December 23, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants