GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting

 Print  |  
Question:  Shell Script to track File Changes

Answer: Write a shell script to save the output of 'ls -ltr' every five minutes and after every hour it should print which all files are changed/modified/created.


October 10, 2009 11:41:39 #2
 swetha_0505   Member Since: October 2009    Total Comments: 4 

RE: Shell Script to track File Changes
 
find . -mtime 0   # find files modified between now and 1 day ago (i.e., within the past 24 hours)

find . -mtime -1  # find files modified less than 1 day ago (i.e., within the past 24 hours, as before)

find . -mtime 1    # find files modified between 24 and 48 hours ago

find . -mtime +1  # find files modified more than 48 hours ago

find . -mmin +5 -mmin -10 # find files modified between 6 and 9 minutes ago

                                            
     

 

Back To Question