Refresh a folder size every two seconds
Build a paste-ready command, then review its compatibility and effects before running it.
watch -n 2 du -sh <folder>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linuxwatch is not installed by default on macOS.
Operational knowledgereview due 2027-01-19
Requirementswatchwatch must be installed and available on PATH.
Version supportwatch Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsEvery 2.0s: du -sh uploadsRepresentative successful output; values vary with the selected target and system state.
Known errorswatch: command not foundwatch is missing or is not available on PATH.
Verifywatch -n 2 du -sh {{folder}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01watchCommandRuns the watch stage of this one-liner.
02-nOptionApplies the command-specific numeric, dry-run, or non-resolving mode.
032ArgumentPasses 2 to watch.
04duArgumentPasses du to watch.
05-shOptionConfigures watch with the -sh option.
06<folder>ParameterA value supplied in the Fill parameters section.
Example input
watch -n 2 du -sh uploads
Example output
Every 2.0s: du -sh uploads
1.7G uploads
# two seconds later
1.8G uploads
Illustrative output — exact values vary by system and data.
Runbooks
Official sources