Files created on specific time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Files created on specific time
# 1  
Old 07-06-2015
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 result.

Please advice on this.

Thanks-
Pokhraj
# 2  
Old 07-07-2015
Here's an option, assuming there's no spaces in the file names:
Code:
find . -type f -mtime -1 -printf '%f %TH%TM\n' | awk '$NF=="1845" {print $1}'

# 3  
Old 07-07-2015
Thanks.. It is working....

Thanks-
Pokhraj

---------- Post updated at 11:45 AM ---------- Previous update was at 10:38 AM ----------

Hello Gurus,
Also one more confusion.
If I wanted to get a file a time range between 6:45 pm to 7:15 pm, then how can I achieve the same?

Thanks-
Pokhraj
# 4  
Old 07-07-2015
Try a > && < instead of == in the awk statement.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Delete all files created in specific year

I have more than 200K files created in year 2017 under directory having size of 50GB. I want to all these files in one shot. Is there any faster option available with find command to delete all these file ? (6 Replies)
Discussion started by: sp23029
6 Replies

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

3. Shell Programming and Scripting

Listing the file name and no of records in each files for the files created on a specific day

Hi, I want to display the file names and the record count for the files in the 2nd column for the files created today. i have written the below command which is listing the file names. but while piping the above command to the wc -l command its not working for me. ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies

4. Shell Programming and Scripting

Display files created on particular date & time

Hi , I have BASH system & i am trying to display the files created on a particular date and time, and after displaying those files I also want to delete all those files.Can anyone of you help me out for this............. Thanx Original post contents restored... Please do not erase the question... (3 Replies)
Discussion started by: rakeshtomar82
3 Replies

5. Shell Programming and Scripting

Removal of files/folders created during a period of time

Hi, I have some folders (containing files) which gets created daily and names start with 'TT_' . I would like to remove these folders every month end. Could you please provide me the commands and also the syntax to schedule through crontab. Thanks, Archana (3 Replies)
Discussion started by: archana.n
3 Replies

6. UNIX for Dummies Questions & Answers

How to move files based on filetype and time created?

Hi, I'm trying to improve my Unix skills and I'm wondering what is the best way to move some files based on filetype and attributes like time created? For instance, lets suppose I have a directory with many different files in it and I'd like to move all the jpgs that were created between May... (6 Replies)
Discussion started by: LuckyTommy
6 Replies

7. Shell Programming and Scripting

Delete files created before specific date.

There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there: /usr/WebSphere/AppServer/logs # ls -l -rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 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. Filesystems, Disks and Memory

How to list files with specific created date

Hi, Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX. I would like to check for the total files came into my disk on 1st May. Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies

10. Shell Programming and Scripting

List files created between specific date and time

Hi I need to write a script to list files in a directory created within specific date and time for eg list files created between Apr 25 2007 11:00 to Apr 26 2007 18:00. and then i have to count them Any suggestions pls ? (3 Replies)
Discussion started by: jazjit
3 Replies
Login or Register to Ask a Question