query for a file created at a particular time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting query for a file created at a particular time
# 1  
Old 01-25-2007
query for a file created at a particular time

Hi guys

I need to find out a file created at 'x' time and the name of the file is rag.rxt

100's of these files are created every minute and i dont know how to find the file created at a particular time. pls help me with the command to search that.

thanks in advance
# 2  
Old 01-25-2007
It seems a bit odd, but you can use the find(1) command with two -newer expressions. In short, you create two "range" files using touch(1) then search for the files modified between them. For example, say you're searching for one or more files modified between 11:55 pm and midnight on Januray 20th of this year:

touch -m -t 200701202355.00 /tmp/lower
touch -m -t 200701202359.59 /tmp/upper
find . -type f -newer /tmp/lower ! -newer /tmp/upper



Note, this range works only on a file's MODIFIED time (mtime) not its last access time (atime) or status change (ctime). You can add additional expressions to refine your search. I hope this helps.
# 3  
Old 01-26-2007
thanks a lot for your reply. i did help me identify the files.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find if create time of last created file in a directory is older than 5 minutes

A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes? OS is AIX (3 Replies)
Discussion started by: malaika
3 Replies

2. Shell Programming and Scripting

How to send a file in UNIX through email which is created only 15 minutes before the current time?

I wanted to send an email to the client whenever there is failed record created in a /feed/HR-76/failed folder after processing of feed file. I can find out with the help of below script that what is the new file created but that file didn't make just 15 minutes before. ... (1 Reply)
Discussion started by: puneetkhullar
1 Replies

3. Shell Programming and Scripting

Segregate files based on the time they are created

Hi All, I have scenario where I need to zip huge number of DB audit log files newer than 90 days and delete anything older than that. If the files are too huge in number,zipping will take long time and causing CPU spikes. To avoid this I wanted to segregate files based on how old they are and... (2 Replies)
Discussion started by: veeresh_15
2 Replies

4. UNIX for Dummies Questions & Answers

At jobs - created date and time

Hi, I'm running atq for a user and its showing 2 'at' jobs in the queue to start at a later time. > atq Is there any way i can find out the creation date/time of these jobs? and ideally what job created them and what script(s) they are going to run? All i can see is the job number and... (3 Replies)
Discussion started by: finn
3 Replies

5. Shell Programming and Scripting

Files created on specific time

Hello Gurus, I am facing one issue to get a file for a specific time. There are about 300 files created between 6.30 pm to 7.15 pm everyday. Now I wanted only the file which is created on 6.45pm. No other files required. I have used "find" command to get the files, but not getting the expected... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

6. Shell Programming and Scripting

Capture time of File last created.

Hi .. I have a list of filenames in a particular file. All thse files get generated in the same directory. No w i want to find out which of thse got generated last and capture that time . Have written a while loop but seems getting struck ... while read line do if then rvst_capt_time=... (7 Replies)
Discussion started by: ultimatix
7 Replies

7. UNIX for Dummies Questions & Answers

how to know what time one user was created?

I am using RHEL. I wan to know the creation time of one user? which command? (4 Replies)
Discussion started by: cqlouis
4 Replies

8. Shell Programming and Scripting

Copying files created after a specified date/time

I need to write a script that copies files from one directory to another that were created after "today 6:30". This script will be NOT be ran at the same time each day. any help is appreciated. (2 Replies)
Discussion started by: jm6601
2 Replies

9. UNIX for Advanced & Expert Users

File created time

I have lot .log files in a directory.I need to take the one got created today.Is there any way to get the time of creation of a file? (6 Replies)
Discussion started by: yakyaj
6 Replies

10. Shell Programming and Scripting

Determine date and time the file was created through shell scripts

Can I determine when the particular file was created, in korn-shell. Can please someone help me. If possible please mail the solution to me. my mail id: bharat.surana@gmail.com (1 Reply)
Discussion started by: BharatSurana
1 Replies
Login or Register to Ask a Question