LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-08-2016, 12:35 AM   #1
sudharshandatla
LQ Newbie
 
Registered: Sep 2015
Posts: 22

Rep: Reputation: Disabled
Linux Space Issue


Hi All,

/var/log/messages file is having more than 4GB, can you anybody let me know how to delete old entries from file or how to get the space on this..

Regards/Sudharshan
 
Old 08-08-2016, 01:09 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
backup the file just in case you need it, or if you're sure that you want to get rid of it and you will not need it anymore then try the command below.


Quote:
echo "del" > /var/log/messages
 
Old 08-08-2016, 02:07 AM   #3
Bubushi
LQ Newbie
 
Registered: Jan 2015
Distribution: Centos, RedHAT, Fedora, Slackware
Posts: 6

Rep: Reputation: Disabled
Why don't you use logrotate?

You will have the ability to specify how much your logs will be sited on your system, you can compress them as well.
 
Old 08-09-2016, 12:44 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Most systems have /var/log/messages already in logrotate. Check /etc/logrotate.conf, /etc/logrotate.d.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tab space issue in script arun natarajan Linux - Newbie 3 04-17-2016 11:02 PM
Disk space issue bk.satish Linux - Newbie 2 09-22-2014 01:32 PM
[SOLVED] Disk Space issue sandeep002gupta Linux - Server 6 06-20-2014 08:13 AM
Disk Space Issue nbjayme Linux - General 5 02-21-2004 07:25 AM
Disk Space Issue. jesterwhite Linux - General 3 03-08-2003 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration