LinuxQuestions.org
Help answer threads with 0 replies.
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 11-22-2012, 06:14 AM   #1
manju98458
LQ Newbie
 
Registered: Nov 2012
Posts: 20

Rep: Reputation: Disabled
Searching file and folder


Greetings,

I have requirement where i have to track the files and folder in linux servers what are changes happened from last one year.

Please let me know if any command syntax or script
 
Old 11-22-2012, 06:26 AM   #2
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
The find command can probably be used.

Code:
# find between today and 365 days
find /start/path -mtime -365 -print

# find between 100 and 365 days old
find /start/path -mtime +100 -mtime -365 -print

code]# find older then 365 days
find /start/path -mtime +365 -print
 
Old 11-22-2012, 06:33 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
You can refer to systen logs under /var/log/ directory and then various types of logs files available for any changes made to the server, or if any other incidents/errors occured.
On the other hand, you could simply use find command to seach for files in whole server, which have been modified in last one year, as follow:
Code:
find / -mtime -365 -exec ls -la {} \;
It will list out all files modified in last one year. But keep in mind that "find" cmd may result thousands of files modified in last one year. So it's better you search such modified files in periods of 2 or 3 months.
Read: http://unixhelp.ed.ac.uk/CGI/man-cgi?find
 
  


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
searching a particular string in all files of a single folder dinakumar12 Linux - Newbie 5 06-27-2011 03:23 PM
command for searching a folder sattulinux Linux - Newbie 10 11-29-2010 01:03 PM
Searching for a folder on entire system rjo98 Linux - Newbie 6 07-17-2009 09:02 AM
searching text within a folder in linux muby Linux - Newbie 4 10-08-2007 08:45 AM


All times are GMT -5. The time now is 10:57 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