Get filelist in a folder which is created in last x hours


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Get filelist in a folder which is created in last x hours
# 1  
Old 04-09-2014
Get filelist in a folder which is created in last x hours

Hi ,

I am looking for some help in getting the list of files matching some pattern in a folder and those were created in last X hours.


Please help.

Thanks in advance.
# 2  
Old 04-09-2014
Code:
find /user/home/log -type f -name "*.log" -mmin -$((X * 60))

you can replace 'X' with number of hours, "/user/home/log" with the directory and "*.log" with your required file format
This User Gave Thanks to SriniShoo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Large crout files created in /tmp folder

Hello All, We are having a archiving script which runs every monday. When ever the script runs it creates crout* files in /tmp folder. This file appends till /tmp become 100% full. We are facing this problem now very frequently. We caanot delete this files,we have to kill the script. when we... (5 Replies)
Discussion started by: Upendra Bhushan
5 Replies

2. Shell Programming and Scripting

Select only the files created in the last 24 hours

Hi There I am trying to create a shell script (.ksh) that will be run on AIX 5300-10 to scp files from one server to another. The only files I am interested in are the ones that were created in the last 24 hours of whenever the script was run. There are numerous other files in the source... (6 Replies)
Discussion started by: jimbojames
6 Replies

3. UNIX for Advanced & Expert Users

default size of a newly created folder

Hi all, In linux how to create a directory with specified size, so that it can be used only up to the mentioned size. Actually my question is, whether we can do directory quota in linux. mounting the directory in a partiton will do that, but do we have any other option... (1 Reply)
Discussion started by: anishkumarv
1 Replies

4. Shell Programming and Scripting

Check file created is less than 4 hours or not.

Hi, I need to check some files in one directory whether any files has been created before 4 hours(ie, less than 4 hours from the current time). Can anybody help me out..? Thanks in advance..! (21 Replies)
Discussion started by: Kattoor
21 Replies

5. UNIX for Dummies Questions & Answers

how to find folder size with created date

hi, please give me adivse .how to find the folder size with created created date . eg: i have directore and in that sub directoties and so on.. /home/mud/abc/dcb/ for this i want output like this path size date -------------------------------------------... (3 Replies)
Discussion started by: muddasani
3 Replies

6. Shell Programming and Scripting

Deleting the contents of a folder older than X hours

Every day a new .zip file is uploaded to a folder and at mid-night the zip file is to be extracted into a /data/ folder, inside a date-named folder. # This should extract the contents of a zip file into the /data/ folder into a date based folder /usr/bin/unzip -a -o... (15 Replies)
Discussion started by: worchyld
15 Replies

7. UNIX for Dummies Questions & Answers

Finding a file created within the last 24 hours

which out of atime, ctime, or mtime are the closest to diplaying only the files created within the last 24 hours. is it even possible to find only the files created in the last 24 hours, because I heard that unix files don't hold the creation time as a property of the file. (3 Replies)
Discussion started by: raidkridley
3 Replies

8. Shell Programming and Scripting

Entering in to recent created folder

Hi, I had problem I have a script after each run, which creates a new folder under "testrun", I used to find recent createfolder by using ls -ltr in testrun folder. Is there any script which facilitates, going directly to recent createfolder under "testrun":confused: Plz help.. (7 Replies)
Discussion started by: prasad2k.java
7 Replies

9. Shell Programming and Scripting

list the file created before 24 hours using ls command

I want to list the files created before past 24 hours using ls command. please help me on this (7 Replies)
Discussion started by: jayaramanit
7 Replies

10. Shell Programming and Scripting

Files created in last 24 hours

I need a script which list the files which is starting with the word heap*** and that is created before past 24 hours.I need the script using find command. please help me on this. (1 Reply)
Discussion started by: jayaramanit
1 Replies
Login or Register to Ask a Question