Skip to content

Instantly share code, notes, and snippets.

@devasheeshG
Last active August 14, 2025 08:23
Show Gist options
  • Save devasheeshG/7ac34ca264c9712469dac9e6a555149b to your computer and use it in GitHub Desktop.
Save devasheeshG/7ac34ca264c9712469dac9e6a555149b to your computer and use it in GitHub Desktop.
Delete logs of all docker containers
sudo sh -c 'du -sh /var/lib/docker/containers/*/*-json.log 2>/dev/null' && sudo sh -c 'truncate -s 0 /var/lib/docker/containers/*/*-json.log 2>/dev/null' && echo "Docker logs cleared successfully"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment