GNU, linux based systems, free software and other computer related things...

DELETING SYSTEM LOGS to save space

Logs are placed in /var/log directory (following Filesystem Hierachy Standard FHS).

Some applications need log files or directories to exist or some error will happen, so we are going to convert all log files into zero byte length files:

/usr/bin/find /var/log -type f | /usr/bin/xargs -I log_file /bin/bash -c "/bin/echo -n \"\" > \"log_file\""
You can freely copy, change or create derivative works from this page contents, only requisite is adding a link to this web page.