GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  
 Shell Scripting  |  Question 47 of 47    Print  
Shell Script to track File Changes
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.


  
Total Answers and Comments: 2 Last Update: October 27, 2009     Asked by: iblue 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: iamjogi
 

Setup crontab entries to run the commands repeatedly.



Above answer was rated as good by the following members:
pmchaurasia
August 23, 2009 17:49:08   #1  
iamjogi Member Since: August 2009   Contribution: 2    

RE: Shell Script to track File Changes

Setup crontab entries to run the commands repeatedly.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
October 26, 2009 11:41:39   #2  
swetha_0505 Member Since: October 2009   Contribution: 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


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : by using  :                 exec

Latest Answer : Broadly categorised in 3 for  while until ...

Latest Answer : The best way is to open a read only file. use SUDO, because you do not know what or who is the owner of the file in this scenario. ...

Latest Answer : global variable is created using export command in ksh - export x='name' In csh its created using setenv command-setenv x 'name'this 'x' variable will be visible in current shell as well as in child shell also.local variable ...

If you have a string "one two three", Which shell command would you use to extract the strings?

Latest Answer : Both of these work.cat test.sh | grep ^$grep -v . test.sh ...

When you login to a c shell, which script would be run first? (before the terminal is ready for the user)

Latest Answer : substring=${string_variable_name:starting_position:length} ...

Latest Answer : cat test.txt | head -25 | tail -1 ...

Latest Answer : search for the character n in filename and replace it with xyz.sed 's/n/xyz/g' filename ...


 Sponsored Links

 
Related Articles

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

System Implementation

In the previous articles relating to SDLC Stages we discussed about Project Planning and Feasibility Study moved on to System Analysis and Requirements which lead to Systems Design. Systems Design will naturally lead to another stage where it becomes closer to the actual deployment of the p
 

System Analysis and Requirements

In the previous chapter, we’ve discussed about project planning and feasibility study. That stage was important because it tries to establish a problem in our highly technological world. As our understanding on what we can do in computers evolve and so are the things that we need to make t
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Recording Test Script With WinRunner

How To Use a Wizard to Record a Test Script With WinRunner If you have a script that you want to convert with WinRunner, you can use the DataDriver Wizard to transform the script into a test that is driven by data. For instance, if you want your test script to include things such as checkpoints or v
 

WinRunner Script Design Tips

Scripts play an important role in the function of WinRunner. Those who wish to successful with this program will need to learn how to properly create scripts. In this article, I will provide you with a number of useful tips for script creation. The first tip of script development is to always place
 

Operating Systems and IT Certification

With the burst of information technology that is becoming a part of the dominant culture throughout the world, are programs that are designed to help those in this area to grow in knowledge.  By understanding the different technologies that are available, one is able to use them and impleme
 

Server Side Scripting

Server Side Scripting Client Side Programming In web applications client side programming is usually written in HTML meanwhile the application servers the middle tier in three tier client server architecture are usually written in C or Java By using a scripting language embedded in HTML web servers
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape