Skip to content

Instantly share code, notes, and snippets.

@Kyle-Falconer
Created August 12, 2016 20:36
Show Gist options
  • Save Kyle-Falconer/44aedcda4eb3cb91f36f99c358f3155b to your computer and use it in GitHub Desktop.
Save Kyle-Falconer/44aedcda4eb3cb91f36f99c358f3155b to your computer and use it in GitHub Desktop.
Empty a file in place.
#!/bin/sh
truncate -s 0 $1
# example, to erase the logs:
# sudo truncate -s 0 /var/log/apache2/*
# sudo truncate -s 0 /var/log/nginx/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment