ls files newer than 6 hours


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ls files newer than 6 hours
# 1  
Old 03-30-2011
ls files newer than 6 hours

How do I list al files in a folder with a creation date/time newer than 6 hours?
# 2  
Old 03-30-2011
Here is a similar question, and a few answers.

https://www.unix.com/unix-dummies-que...e-60-mins.html
# 3  
Old 03-30-2011
In general UNIX files do not support a creation date. The last time modified is probably what you want:

linux or with gnu find:
Code:
find /path/to/files -type f -mmin -360 -ls

Almost all unix:
Code:
# assume time how is Wed Mar 30 12:50:27  <your timezone here> 2011
# six hours ago is 2011 (year) 03 (march) 30 (march 30) 0650 (06:50)  ignore seconds
touch -t 201103300650 dummy
find /path/to/files -type f -newer dummy -exec ls -l {} \;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

files older than few hours

Hi All I need to know the command which can be used to list the files which are 3 hours old so that it can be deleted. (3 Replies)
Discussion started by: mskalyani9
3 Replies

2. UNIX for Dummies Questions & Answers

Find files newer than x days

We had an arrant rsync run and started copying over new files from one system to another. Although this is what we will want to do at some point, for now, we want to maintain the system as it was a few days ago. I am looking for a script that will find files that are newer than x days. ... (5 Replies)
Discussion started by: Leyva62
5 Replies

3. Shell Programming and Scripting

Copy newer files without create

I want the same effect as "cp -u" but without create missing files, it is possible ? ps: bash (2 Replies)
Discussion started by: mrxrsd
2 Replies

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

5. Shell Programming and Scripting

How to find files by hours old?

I need to be able to do the following: Find files in multiple directories that are 6 hours older than the current time? I am using KSH I tried mmtime but it was not a valid option Any help would be great. Thank you! (2 Replies)
Discussion started by: llsmr777
2 Replies

6. UNIX and Linux Applications

sftp -> put : How to uplaod only newer files

I have tried winscp, filezilla to copy data from windows xp SP2 machine to the sun sparc unix machine. However speed is around 120 to 130 kb/sec. I do have lot of files & with large size. So I switched to windows command prompt & transfered few files using sftp command. Its very fast as compared... (0 Replies)
Discussion started by: _prasad
0 Replies

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

8. Solaris

To copy the files newer than specific date

Dear all, Can you help me in copying files newer than speciifc date Thanks in advance, Rajesh (3 Replies)
Discussion started by: RAJESHKANNA
3 Replies

9. Shell Programming and Scripting

copy only newer files? (xcopy equivalent)

Howdy folks. I have a problem - I'm sure the answer is very simple, but I can't work it out. I want to create a UNIX shell script that does what I've been doing in DOS batch files for years - that is, backing up files. By which I mean copying files from a source directory to a target... (4 Replies)
Discussion started by: Chomps
4 Replies

10. UNIX for Dummies Questions & Answers

Find files newer than...

Is there a way to use the find command to locate files newer than a specific date? Thanks! --Alex (4 Replies)
Discussion started by: vertigo23
4 Replies
Login or Register to Ask a Question