Skip to content

Instantly share code, notes, and snippets.

@zero-master
Last active May 24, 2018 09:57
Show Gist options
  • Save zero-master/e726d0c8be5d002561c41fa7fdb90070 to your computer and use it in GitHub Desktop.
Save zero-master/e726d0c8be5d002561c41fa7fdb90070 to your computer and use it in GitHub Desktop.
Truncate all log files in a directory
#!/bin/bash
# Dry run
find . -type f -name "*.log" -exec echo {} \;
find . -type f -name "*.log" -exec truncate -s 0 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment