Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux bash command to clean up log files in /var/log

# 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 in /var/log

# 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 :: openssl check certificate expiration 
Shell :: install node and npm ubuntu 
Shell :: Problem binding to port 80: Could not bind to IPv4 or IPv6. 
Shell :: getcomposer 
Shell :: how to install kubectl in ubuntu 
Shell :: cp command exclude files 
Shell :: append to a file from terminal 
Shell :: configure static ip address ubuntu server 20.04 
Shell :: new ssh key github 
Shell :: git clone syntax 
Shell :: install chocolatey on windows 
Shell :: expo init 
Shell :: add user to dialout group 
Shell :: send post request webhook bash scipt 
Shell :: sublime text editor download for linux 
Shell :: To see details about a wifi connection on linux 
Shell :: running localhost check in linux terminal 
Shell :: zsh: permission denied 
Shell :: configure static ip address linux 
Shell :: cordova android generate keystore 
Shell :: bash for i 
Shell :: Contact the upstream for the repository and get them to fix the problem. 
Shell :: remove a file from a commit 
Shell :: git bash terminal weird characters 
Shell :: linux remove link 
Shell :: pyenv install latest version 
Shell :: how to run code from github 
Shell :: jupyter show digits 
Shell :: xrdp choose desktop environment 
Shell :: move all files from one directory to another 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =