Easy way to limit file size (stdout) on a shell script level?
You can use head
for this:
command | head -c 1G > /var/tmp/output.log
It accepts K, M, G and the like as suffixes (bytes are the default). Append 'B' to use the base 10 versions.
You can use head
for this:
command | head -c 1G > /var/tmp/output.log
It accepts K, M, G and the like as suffixes (bytes are the default). Append 'B' to use the base 10 versions.