The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command to list files that are created before some date csreenivas SUN Solaris 3 06-27-2007 06:34 PM
How to list files with specific created date Draculla Filesystems, Disks and Memory 2 05-03-2007 11:45 PM
List files created between specific date and time jazjit Shell Programming and Scripting 3 04-27-2007 01:19 AM
List Files & Folders created/modified tipsy Shell Programming and Scripting 2 10-24-2006 01:22 PM
command unix to list all files created since n month ago yacsil Shell Programming and Scripting 8 12-15-2003 01:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-12-2004
rsonakiya rsonakiya is offline
Registered User
  
 

Join Date: May 2004
Posts: 2
How to list files Created in last 2 hrs

I wanted to know what command should I use to see the files created in last 2 hours in a given directory.

I know to see the files changed in last one day I can use this:
find /admin//dump -type f -ctime -1 -print | xargs ls -lt|pg

However I am not getting what should I use if I wanted tol ist all the files created in last 2 hours.

Thanks..

R
  #2 (permalink)  
Old 05-12-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
We have some rules here. One on them is:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting.

I have deleted your duplicates.
  #3 (permalink)  
Old 05-12-2004
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,759
Use touch to change a file data on a temp file in your directory
then use find.

Code:
cat "hi " >  t.tmp
# set the file time to 2 hours ago
touch -t 200405121120  t.tmp 
find /admin//dump -type f  -newer t.tmp -print -exec ls -lt {} \; | pg
  #4 (permalink)  
Old 03-02-2009
shivamdhawan shivamdhawan is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 1
find /admin//dump -type f -newer t.tmp -print -exec ls -lt {} \; | pg

This looks good but I am not able to understand this command...can you explain it?
:?
  #5 (permalink)  
Old 03-02-2009
Whiteboard's Avatar
Whiteboard Whiteboard is offline
Registered User
  
 

Join Date: Feb 2009
Location: @........
Posts: 111
t.tmp is a sample file that you are creating at 11.20 and then listing all the files after that particular time stamp... thats why you are using -newer t.tmp


You can modify the timestamp of a file using

Code:
touch -t yyyymmddhhmm filename
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0