LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-22-2010, 05:49 AM   #1
rakeshkranjan
LQ Newbie
 
Registered: Jul 2009
Posts: 6

Rep: Reputation: 0
how to find files which is modifed 01 year before


how to find files which is modifed 01 year before, with size detail
 
Old 10-22-2010, 06:35 AM   #2
T0sh1r0
Member
 
Registered: Oct 2010
Posts: 51
Blog Entries: 1

Rep: Reputation: Disabled
Files modified 365 days ago:
find . -type f -mtime 365 -exec ls -l {} \;

Files modified 365 days or more ago:
find . -type f -mtime +365 -exec ls -l {} \;

Files modified 365 days or less ago:
find . -type f -mtime -365 -exec ls -l {} \;

For other options: man find ;-)

Last edited by T0sh1r0; 10-22-2010 at 06:56 AM.
 
Old 10-22-2010, 06:36 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

find /full/path/to/startpoint -mtime +365 -ls

This shows files that are modified a year (and older) ago.

If you need files that are between 1 and 2 years old:

find /full/path/to/startpoint -mtime +365 -mtime -730 -ls

+NUMBER means older then NUMBER, -NUMBER means younger then NUMBER.

/full/path/to/styartpoint can be changed to a dot (.) if you execute the find command from the correct directory.

Hope this helps.
 
Old 10-22-2010, 06:39 AM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
Code:
find . -type f -mtime 365 |xargs ls -l
Will give the file information too

or
Code:
find . -type f -mtime 365 |xargs ls -sh
Will give the file size only
 
  


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
How to : Find last login year in HPUX ? avklinux Other *NIX 0 03-02-2009 06:06 PM
How to : Find last login year ? avklinux Linux - General 3 02-12-2009 05:14 PM
Order files by last modifed Madone_SL_5.5 Linux - Newbie 1 12-13-2006 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:53 AM.

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