|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
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. |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
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
|
|||
|
|||
|
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? :? |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
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 |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To list all the files created today with directory path | meetusha.b | UNIX for Dummies Questions & Answers | 4 | 08-18-2008 05:53 AM |
| List files created before Noon 2 days prior | prismtx | Shell Programming and Scripting | 3 | 01-19-2008 11:06 AM |
| command to list files that are created before some date | csreenivas | 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 & Folders created/modified | tipsy | Shell Programming and Scripting | 2 | 10-24-2006 01:22 PM |
|
|