Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to clear log files linux debian

sudo find /var/log -type f -delete
Comment

linux bash how to clear log files debian ubuntu centos

# Run as root, of course.
# For sh shells:
cd /var/log
: > messages
: > wtmp
echo "Log files cleaned up."

# For bash shells:
cd /var/log
> messages
> wtmp
echo "Log files cleaned up."

# This is a better version, does the same thing, less redundancy.

# visit this link for detailed explanation:
https://superuser.com/questions/849413/why-would-you-cat-dev-null-var-log-messages
Comment

linux script to clean up log files

# Run as root, of course.

cd /var/log
cat /dev/null > messages
cat /dev/null > wtmp
echo "Log files cleaned up."
# for detailed exaplanations on this, visit this link:
# https://superuser.com/questions/849413/why-would-you-cat-dev-null-var-log-messages

# /var/log:
# path where logs for the system, running processes etc are usually saved

# cat /dev/null > messages command:
# opens a null file in path /dev/null
# pushes /dev/null file into messages file

# cat /dev/null > wtmp : this is basically the same

Comment

PREVIOUS NEXT
Code Example
Shell :: bash command to clean up log files 
Shell :: powershell get OS 
Shell :: uninstall npm package 
Shell :: arch linux pacman cannot install 
Shell :: set email and name which gets baked into the every git commit in the local config file found in ./.git/config 
Shell :: how to remove large file from github repo history 
Shell :: shutdown command rhel 7 
Shell :: kde increase fpsz 
Shell :: how to generate ssh key 
Shell :: bash check if string in file 
Shell :: copy file in linux command 
Shell :: install psql mac 
Shell :: openssl serial number 
Shell :: tail journalctl last 100 lines 
Shell :: git login 
Shell :: check connected wifi details on kali 
Shell :: comprimir directorio linux 
Shell :: start docker 
Shell :: how to make directory in ubantu 
Shell :: valgrind example usage 
Shell :: bash get current process id 
Shell :: reset resolv.conf 
Shell :: git switch 
Shell :: install ppt readr for arch linux 
Shell :: instal kdenlive 
Shell :: brew check installed packages version 
Shell :: sl in linux 
Shell :: git pull request 
Shell :: patch: command not found 
Shell :: how to mount device linux 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =