Bitcoin Forum
May 30, 2024, 04:25:37 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [linux/ubuntu] looking for bash script: find & delete all *.log files  (Read 341 times)
freedoge.co (OP)
Hero Member
*****
Offline Offline

Activity: 909
Merit: 506



View Profile
August 19, 2016, 01:54:57 PM
 #1

Hi, i'm looking for script to clean up the log files on whole ubuntu file system (all users) as root.

Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
August 20, 2016, 07:49:09 AM
 #2

Code:
find /var/log/ -type f -name '*.log' -delete

You can run that on / too, but it might delete more than you expect. Stick to /var/log/, that's where logs should go

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
freedoge.co (OP)
Hero Member
*****
Offline Offline

Activity: 909
Merit: 506



View Profile
August 24, 2016, 04:14:32 PM
 #3

Code:
find /var/log/ -type f -name '*.log' -delete

You can run that on / too, but it might delete more than you expect. Stick to /var/log/, that's where logs should go

thank you so much i'm going to try it.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!