LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 06: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, 07:35 AM   #2
T0sh1r0
Member
 
Registered: Oct 2010
Location: Liège, Belgium
Distribution: Debian / Slackware
Posts: 47
Blog Entries: 1

Rep: Reputation: 7
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 07:56 AM.
 
Old 10-22-2010, 07:36 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 07:39 AM   #4
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
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


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


All times are GMT -5. The time now is 06:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration