Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to clear log files linux debian

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

clear log file space linux

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 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

clear log file space linux

find /var/log -type f -regex ".*.gz$"
find /var/log -type f -regex ".*.[0-9]$"
Comment

PREVIOUS NEXT
Code Example
Shell :: how to close a port mac 
Shell :: rm hidden files linux 
Shell :: show connected wifi password windows 
Shell :: QNAP NAS crontab reset 
Shell :: pip install geopandas 
Shell :: git change crlf to lf 
Shell :: snap install docker 
Shell :: run powershell command as administrator 
Shell :: find current working directory bash 
Shell :: install modules from text file pip 
Shell :: linux microphone noise reduction 
Shell :: Untracked files: (use "git add <file..." to include in what will be committed) 
Shell :: sveltekit normalize css 
Shell :: choco list local packages 
Shell :: force logrotate linux 
Shell :: find max depth linux 
Shell :: ffmpeg shrink video size 
Shell :: borrar una rama git 
Shell :: set git credentials so that i never ask for username and password while pushin 
Shell :: how to install unzip in ubuntu 
Shell :: xlsx Module ../../xlsx/types has no exported member IProperties. Did you mean Properties? 
Shell :: uninstall openshot linux 
Shell :: linux install deb file 
Shell :: install chance in cypress 
Shell :: yarn test only one file 
Shell :: how to find distro name 
Shell :: This system is not registered with an entitlement server. You can use subscription-manager to register. 
Shell :: powerline fonts install 
Shell :: clean up untagged docker images 
Shell :: git revert file to master 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =