Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-14-2012
Registered User
 
Join Date: May 2005
Posts: 288
Thanks: 8
Thanked 0 Times in 0 Posts
[Solved] remove all files of 2010

Hi,
how to use "rm" to delete only files from year 2010 ?

Thank you.
Sponsored Links
    #2  
Old 08-14-2012
elixir_sinari's Avatar
Gotham Knight
 
Join Date: Mar 2012
Location: India
Posts: 1,370
Thanks: 87
Thanked 476 Times in 456 Posts
Something like this:

Code:
touch -t 201001010000.00 start-yr
touch -t 201012312359.59 end-yr
find . -newer start-yr \! \( -newer end-yr \) -exec echo rm {} \;

Remove the echo if you are happy with the output.

Last edited by elixir_sinari; 08-14-2012 at 05:51 AM.. Reason: Typo
Sponsored Links
    #3  
Old 08-14-2012
Registered User
 
Join Date: May 2005
Posts: 288
Thanks: 8
Thanked 0 Times in 0 Posts
thank you.
Yes worked.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[Solved] Remove Duplicates and Sum in a spreadsheet Giorgio C UNIX for Dummies Questions & Answers 2 05-30-2012 11:47 AM
[solved] Can't Remove Virt Adapter on VIO Vit0_Corleone AIX 0 03-24-2012 07:50 AM
[Solved] Remove LaTex Tag with perl mortl Shell Programming and Scripting 2 01-04-2012 10:56 AM
[solved] merging two files and writing to another file- solved mlpathir Shell Programming and Scripting 1 10-07-2010 06:41 PM
[solved] remove pattern with sed a27wang Shell Programming and Scripting 8 09-17-2010 01:17 PM



All times are GMT -4. The time now is 06:34 AM.