Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Newbie > Delete FIles older than a Set date or number of hours

Forgot Password?
 Linux Newbie   If you're new to the wonderful world of Linux, start here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 12-16-2004   #1 (permalink)
Just Joined!
 
Join Date: Dec 2004
Posts: 4
Delete FIles older than a Set date or number of hours

I am trying to delete fines on a remote server that has become very full
I am new to linux but this task has been lumpe with me
Have been told i have to mix find and rm so would it be some thing like this ?
to remove more than 24 hour old files. With comfirm

find / Desktop/ -mtime +24 rm -i

i just have no idea really but an trying to make this work
trancestrances is offline  



Reply With Quote
Old 12-16-2004   #2 (permalink)
Linux Guru
 
Vergil83's Avatar
 
Join Date: Mar 2004
Posts: 2,408
I think would be something like
Code:
find / Desktop/ -mtime 1 | rm -i
although I would look around the man pages of find and rm
Vergil83 is offline   Reply With Quote
Old 12-16-2004   #3 (permalink)
Just Joined!
 
Join Date: Dec 2004
Posts: 4
No that don t seem to do it

$ find / Desktop/ -mtime 1 | rm -i
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
$ find / Desktop/ -mtime 1 | rm [-i]
rm: [-i]: No such file or directory
$ rm - i
rm: -: No such file or directory
rm: i: No such file or directory
$ rm -i
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
trancestrances is offline   Reply With Quote
Old 12-16-2004   #4 (permalink)
Just Joined!
 
Join Date: Dec 2004
Posts: 4
rm -i < `find home/ -mtime 24`
no
find home/ -delete -mtime +24
no
rm -i > `find / home/ -mtime +24`
trancestrances is offline   Reply With Quote
Old 12-17-2004   #5 (permalink)
Just Joined!
 
Join Date: Dec 2004
Posts: 4
now was also thinking
But that dont work either
find / -name *.old.* -print > /tmp/delete_files.txt
trancestrances is offline   Reply With Quote
Old 12-17-2004   #6 (permalink)
Just Joined!
 
Join Date: Dec 2004
Posts: 12
Try

Code:
find / -name *.old.* -mtime 1 -exec rm {} \;
You might want to try

Code:
find / -name *.old.* -mtime 1 -exec ls -l {} \;
first

Cheers

Spook
spookt is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 03:51 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1