Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux bash command to clean up log files

# 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 command 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 :: linux bash clean up log files 
Shell :: mkdir rm folder 
Shell :: gitlab docker setup 
Shell :: how to overwrite file linux cli 
Shell :: grafana docker password 
Shell :: install fira code ubuntu 
Shell :: cara install laravel 
Shell :: kde 144 fps 
Shell :: add ssh key linux 
Shell :: vagrant box remove version 
Shell :: push particular commit in git 
Shell :: docker container with powershell 
Shell :: running splash in docker command line 
Shell :: install package in docker 
Shell :: how to git login in terminal 
Shell :: gitbash update 
Shell :: sudo apt-get dbeaver 
Shell :: git diff two commits 
Shell :: how to get out of branch git 
Shell :: unzip file to folder 
Shell :: git remove added file to commint 
Shell :: uninstall people app windows 10 
Shell :: git clone permission denied 
Shell :: install vscodium 
Shell :: mac compress tar.gz pc 
Shell :: brew check installed version 
Shell :: remove file history from git 
Shell :: create ssh key for github 
Shell :: serverless sqs batch size 
Shell :: github oauth 2 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =