LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-23-2009, 11:01 AM   #1
ahurd
Member
 
Registered: Sep 2007
Posts: 76

Rep: Reputation: 15
Need terminal command for safely deleting log files and other useless garbage in /


Subject says it all.
 
Old 02-23-2009, 11:06 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,496

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
rm ?
however, only delete the files, created by logrotate not the logfiles.
you could write a script to do it for you.
what other garbage do you want to delete ?
 
Old 02-23-2009, 11:07 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
The trick here is how you define "useless garbage". Also, you don't normally find files in "/". For example, log files are in /var.

"safely deleting" to me means --in part-- that you know that it is safe to delete something. There is no command to give you that info. If you don't know what the file is, then don't delete it.

The command you are looking for is "rm". Enter "man rm" to get all the options, syntax, etc.
 
Old 02-23-2009, 11:29 AM   #4
ahurd
Member
 
Registered: Sep 2007
Posts: 76

Original Poster
Rep: Reputation: 15
The partition of 11.6g on which / is mounted has completely filed up. I did a search on *.log and came up with an incredible number which had accumulated. I want to delete as many files which are safe to delete as I can from the partition in which / is mounted without having to do it one file at a time using konqueror. Being a newbie I do NOT know which files are safe to delete, and that is what my post is asking--how do I go about recapturing space in the / partition without having to delete files one at a time using knowledge I do not possess.
 
Old 02-23-2009, 11:32 AM   #5
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Wink

Hi There,

deleting files here means removing files. 'rm' command will remove the files which can recovered with another cumbersome process. If you want to completely remove the files, then use 'rm -rf' command. But make sure that this way, you will not be able to recover your deleted files...

Cheers,
Kapil.
 
Old 02-23-2009, 11:39 AM   #6
ahurd
Member
 
Registered: Sep 2007
Posts: 76

Original Poster
Rep: Reputation: 15
Sorry about subject being unclear. It is not a question of what command to use, which I knew even though a newbie, but which files to delete that are not necessary to keep.
 
Old 02-24-2009, 05:44 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
In /var/log, I think you can delete just about everything.

But first, what are the really big files? (On my system, after running for many months, everything in /var/log adds up to only 51MB)
 
Old 02-24-2009, 05:44 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
In /var/log, I think you can delete just about everything.

But first, what are the really big files? (On my system, after running for many months, everything in /var/log adds up to only 51MB)
 
Old 02-24-2009, 06:50 AM   #9
mohtech
Member
 
Registered: Dec 2004
Location: Denver Colorado
Distribution: Kubuntu/Debian
Posts: 120

Rep: Reputation: 15
How is your filestystem divided up?

Is everything in / or do you have separate /var /home/ /etc directories?

One question is: how is this computer used? Depending on use, different folders may fill up at different rates, for example /var/www on a webserver etc...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Deleting large amout of files in my trashcan using the terminal ceaseallfeeling Linux - Newbie 2 12-01-2007 03:22 PM
Deleting files from command line goes to trash? HSN Linux - Enterprise 1 02-18-2007 11:38 PM
cat safely without messed up terminal curos Slackware 6 08-20-2006 01:54 PM
Deleting Terminal log!! A.S.A.P! itz2000 Linux - Newbie 4 06-24-2006 04:18 PM


All times are GMT -5. The time now is 10:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration