LinuxQuestions.org
Register a domain and help support LQ
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 06-28-2012, 11:32 AM   #1
vaibhavs17
Member
 
Registered: Mar 2009
Posts: 49

Rep: Reputation: 1
command to find and remove all files from /tmp direct that are older than 5 days old


I tried this

does it look correct?

find . -mtime +5 -exec rm {} /tmp/\;
 
Old 06-28-2012, 11:50 AM   #2
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 18
Try this:

Code:
find /tmp/* -mtime +5 -exec rm {} \;
Source: HowToGeek

Last edited by montel; 06-28-2012 at 11:51 AM. Reason: source
 
1 members found this post helpful.
  


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
Bash script to remove files older than 3 days rust8y Linux - General 26 10-04-2012 08:26 AM
Bash script to remove files older than x days henkoslaw Linux - General 1 06-10-2012 03:55 AM
[SOLVED] Script: find, compress, remove original files, older than x days? blacklion Linux - General 5 02-27-2012 10:22 AM


All times are GMT -5. The time now is 01:26 AM.

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