only find files older than x minutes old


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting only find files older than x minutes old
# 1  
Old 05-18-2006
only find files older than x minutes old

I am looking for a way to show files that have been created within a certain period (say anything older than 10 minutes or so). Is there a command/series of commands I can do this with? As an example, I have the following in a directory:

-rw-r--r-- 1 owner group 70175 May 16 09:10 ICO_CS11_787113367_50467914_1_CS-11.pdf
-rw-r--r-- 1 owner group 70719 May 16 09:24 ICO_CS11_787113367_50467945_1_CS-11.pdf
-rw-r--r-- 1 owner group 70617 May 16 09:30 ICO_CS11_787113367_50467971_1_CS-11.pdf
-rw-r--r-- 1 owner group 70860 May 16 09:30 ICO_CS11_787113367_50467974_1_CS-11.pdf
-rw-r--r-- 1 owner group 70342 May 16 09:31 ICO_CS11_787113367_50467980_1_CS-11.pdf
-rw-r--r-- 1 owner group 70208 May 16 09:36 ICO_CS11_787113367_50468000_1_CS-11.pdf

Pretend it's now May 16 09:40 and I do not want to see the last three files as those are within the last 10 minutes. I only want to see:

-rw-r--r-- 1 owner group 70175 May 16 09:10 ICO_CS11_787113367_50467914_1_CS-11.pdf
-rw-r--r-- 1 owner group 70719 May 16 09:24 ICO_CS11_787113367_50467945_1_CS-11.pdf

Any idea on how this can be done? I am on AIX and writing shell scripts.
# 2  
Old 05-19-2006
see if it helps

May be you could create a file with a timestamp you want and use find's 'newer' option to get the files. Search the site for numerous examples.
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

Check file creation Time minutes and if file older then 5 minutes execute some stuff

Hello all, Info: System RedHat 7.5 I need to create a script that based on the creation time, if the file is older then 5 minutes then execute some stuff, if not exit. I thought to get the creation time and minutes like this. CreationTime=$(stat -c %y /tmp/test.log | awk -F" " '{ print... (3 Replies)
Discussion started by: charli1
3 Replies

3. UNIX for Advanced & Expert Users

Help with get/mget from FTP server with files older than 10 minutes

Hi! I am new to unix and this forum as well.. Can someone please help me : I want to "get/mget" files which are older than 10 minutes from a remote FTP server like "ftp.com". After getting the files to local unix server say "Prod.com" , i need to delete only those files from ftp.com which... (4 Replies)
Discussion started by: SravsJaya
4 Replies

4. UNIX for Advanced & Expert Users

files older than 10 minutes

Hi, I have to find the files older than 10 minutes and remove those files as well as redirect the file names into a log file. i am using sun OS and my unix is not GNU and also not having perl. Could any one suggest me the way to approach. It would be great if script is provided. Also... (8 Replies)
Discussion started by: rohan10k
8 Replies

5. Shell Programming and Scripting

find files created within 30 minutes

find . -name *.txt -mmin -30 This is working in Redhat but not in Solaris.. What is the equivalent option in Solaris? (1 Reply)
Discussion started by: tene
1 Replies

6. Shell Programming and Scripting

Find files which are <n> minutes old

Hi, i want to find certain files which are more than <n> minutes old,i have the command to find the files say <n> days old(as below) but not in terms of minutes. find . -name "14*.000" -type f -mtime +1 Is there any way to find this? Regards, Cherry (3 Replies)
Discussion started by: cherryven75
3 Replies

7. Shell Programming and Scripting

delete files older than 5 minutes in directory (recursively)

sorry guys can some please give me a hint how to achieve this in a slick oneliner? delete files older than 5 minutes in specified directory (recursively) peace (3 Replies)
Discussion started by: scarfake
3 Replies

8. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

9. UNIX for Advanced & Expert Users

find files onder than 15 minutes

Hi Friends, i have to write a script to raise a flag if there are any files that are older than 15 minutes in the directory.The directory is supplied as the parameter to the script. please help with a sample script. Thanks in advance veera (11 Replies)
Discussion started by: sveera
11 Replies

10. Shell Programming and Scripting

files older than 15 minutes

Hi Friends, i have to write a script to raise a flag if there are any files that are older than 15 minutes in the directory.The directory is supplied as the parameter to the script. please help with a sample script. Thanks in advance veera (0 Replies)
Discussion started by: sveera
0 Replies
Login or Register to Ask a Question