LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Searching file and folder (https://www.linuxquestions.org/questions/linux-newbie-8/searching-file-and-folder-4175438257/)

manju98458 11-22-2012 05:14 AM

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

druuna 11-22-2012 05:26 AM

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


shivaa 11-22-2012 05:33 AM

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


All times are GMT -5. The time now is 05:02 PM.