Skip to content

Instantly share code, notes, and snippets.

@cedricmagne
Last active April 22, 2016 13:00
Show Gist options
  • Save cedricmagne/736218b978206cc5163a5fb631d2f0d1 to your computer and use it in GitHub Desktop.
Save cedricmagne/736218b978206cc5163a5fb631d2f0d1 to your computer and use it in GitHub Desktop.
Linux commands
# Truncate a file
$ cat /dev/null >| my_file.log
## OR
$ truncate -s0 yourfile
##if permission denied, use sudo
$ sudo truncate -s0 yourfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment