Finding a file created within the last 24 hours


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding a file created within the last 24 hours
# 1  
Old 10-22-2008
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.
# 2  
Old 10-22-2008
Hammer & Screwdriver

While they may not all show up, or be in a format you like when doing an ls command, all are retrievable.

The stat command is useful for this.
stat -c%x myfile == provides time of last access
%y would give time of last modification
%z would give time of last change
# 3  
Old 10-29-2008
Well....
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????????????????

here it is

find . -type f -name "heap*" -mtime 0
# 4  
Old 11-08-2008
when you set the below variable, "CST" needs to be the time zone your in and you may need to change what character the cut starts at in order to get the full file name. Smilie

DATE_STAMP=`TZ=CST+24 date +'%b %e'`

ls -l |grep "$DATE_STAMP" |grep "heap*" |cut -c55-
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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. (1 Reply)
Discussion started by: Anupam_Halder
1 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. 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

4. Shell Programming and Scripting

finding the file which is modified within last 2 hours

hi, I want to find a file which is modified within last 2 hours i am using sun-os i tried find . -name <filename> -mmin 120 i found that mmin option is not supported in sun-os is there any other alternative option suggestions welcome thanks in advance (5 Replies)
Discussion started by: trichyselva
5 Replies

5. UNIX for Dummies Questions & Answers

Finding the date a file was created

how do i find the date a file was created? (3 Replies)
Discussion started by: trob
3 Replies

6. Shell Programming and Scripting

how to list files between last 6 hours to 3 hours

Hi Frens, I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies

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

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

9. UNIX for Dummies Questions & Answers

Finding only those files older than 2 hours

I need to write a program that will only remove those files that are older than 2 hours. Is there some variation of find . -mtime ? -name '*' that I can use? Thanks as always for your help. Regards, Dave :) (2 Replies)
Discussion started by: mh53j_fe
2 Replies

10. Shell Programming and Scripting

Finding files older than 2 hours

I want to write a sh script that will find files older than 2 hours and tar them. I've had a look at the find man page but can't see how to do it by hours. Help please. Thanx (1 Reply)
Discussion started by: ianf
1 Replies
Login or Register to Ask a Question