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 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 in /var/log 
Shell :: install rest framework django command ubuntu 
Shell :: how to update ubuntu from terminal 
Shell :: grep binary files 
Shell :: git create tag and push 
Shell :: shell show number of files in each folder 
Shell :: git check if there are staged changes 
Shell :: kde up maxfps 
Shell :: generate git ssh key 
Shell :: create folder with shell/bash 
Shell :: printf @ bash 
Shell :: vscode Error: EACCES: permission denied 
Shell :: push the project to github 
Shell :: uninstall nvidia x server ubuntu 
Shell :: role ansible update apt 
Shell :: Could not find com.facebook.yoga:proguard-annotations:1.14.1. 
Shell :: how to erase folder that match characters in linux 
Shell :: bash make multiple directories in current directory 
Shell :: init jest config 
Shell :: valgrind usage 
Shell :: open current dir cmd 
Shell :: how to sort tags on git tag 
Shell :: how to change git password in git bash 
Shell :: heroku ubuntu install 
Shell :: helm docker generate doc 
Shell :: powershell output array as table 
Shell :: merge git branch 
Shell :: install vuex orm 
Shell :: pull a specific branch from github 
Shell :: how to start gnome desktop on fedora terminal 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =