====== BASH - Files - Cleaning Log Files ====== Deletes all log files present inside your /var/log directory. #!/bin/bash LOG_DIR=/var/log cd $LOG_DIR cat /dev/null > messages cat /dev/null > wtmp echo "Logs cleaned up." **NOTE:** Run this as root.
#!/bin/bash LOG_DIR=/var/log cd $LOG_DIR cat /dev/null > messages cat /dev/null > wtmp echo "Logs cleaned up."