GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 27 of 47    Print  
How to find see the file which is created today,s date with time after 10 a.m to 5 p.m?

  
Total Answers and Comments: 2 Last Update: November 15, 2006     Asked by: afzal 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Sharif
 

Hi,

find . -atime 0 -type f -exec ls -ltr {} ;  | grep "`date +%b %d`"

    This command will show the files which are created today. But for ur second part of the quesiton i needto analyse more,

Explanation:

find . -atime 0 -type f -exec ls -ltr {}

   This will list the files where are accessed and created  today.

grep "`date +%b %d`"

    This part of the command will filter out unwanted files which were not created today.

Thanks!

Sharif.S

sharifhere@yahoo.com



Above answer was rated as good by the following members:
nigelj
November 14, 2006 04:54:30   #1  
Sharif        

RE: How to find/see the file which is created today,s ...

Hi

find . -atime 0 -type f -exec ls -ltr {} ; | grep `date + b d`

This command will show the files which are created today. But for ur second part of the quesiton i needto analyse more

Explanation:

find . -atime 0 -type f -exec ls -ltr {}

This will list the files where are accessed and created today.

grep `date + b d`

This part of the command will filter out unwanted files which were not created today.

Thanks!

Sharif.S

sharifhere@yahoo.com


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 15, 2006 06:56:59   #2  
Sharif        

RE: How to find/see the file which is created today,s ...

set -u -a
rm -f out2
find $PWD -atime 0 -type f -exec ls -ltr {} ; | grep `date '+ b d'` | tr -s | tr -d : > out2
echo -------Files Modified Today--------
cat out2 | while read line
do
timechk `echo $line | cut -d -f8`
filename `echo $line | cut -d -f9`
if [ $timechk -gt 1000 -a $timechk -lt 1700 ]
then
echo $filename
fi
done
echo -----------------------------------

#Above Script will help you.

Thanks!

Sharif.S


 
Is this answer useful? Yes | No

 Related Questions

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 : Both of these work.cat test.sh | grep ^$grep -v . test.sh ...

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 ...

What is the basic difference u find between a shell script and perl.I mean the advantages of one over the other.
Read Answers (2) | Asked by : O.Sajit

Latest Answer : set -u -a rm -f out2find $PWD -atime 0 -type f -exec ls -ltr {} ;  | grep "`date '+%b %d'`"  | tr -s " " | tr -d ":" > out2echo "-------Files Modified Today--------"cat out2 | while read linedo   timechk=`echo  $line | cut ...
Read Answers (2) | Asked by : afzal

Folks,I have peculiar kind of error. my script goes likecat inputfile> while read paramdoArray[$i]=$param y=`expr $y + 1`doneWhen i run script passing very large input file. script abends in the middle of execution saying "ksh: script out of range"Possible reason is max array element size is 4095 which is exceeded in my case. Now my question, is there any settings in shell which i can use to increase the max array element size.Guys please post ur suggestions.Thanks!Sharif.S

Latest Answer : head -2 file.txt | tail -1Regardskamalesh ...
Read Answers (6) | Asked by : Ralf Krauseman

Latest Answer : please note that my original answer ate the quote signs, which I'm going to try to make sure get through this time:sed 's/\//g'And in case that gets eaten also, it's a reverse slash, then the less than (


 Sponsored Links

 
Related Articles

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

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
 

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
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

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