LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-25-2009, 05:28 AM   #1
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 12

Rep: Reputation: 0
files edit in the last 2 hours


Dears,
i'm searching for
how to know the file has been edited in the previous 2 hours
all file
what can i do
i am using ubuntu 9.04 server

Last edited by hosney00ux; 08-25-2009 at 05:35 AM.
 
Old 08-25-2009, 05:38 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
Hello,

Check out the man pages for find
Code:
man find
more specific the following options
Code:
-amin
-atime
-mmin
-mtime
That should get you going.

Kind regards,

Eric
 
Old 08-25-2009, 05:42 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
See man find.
Code:
find /path/to/dir -type f -mmin -120
 
Old 08-25-2009, 05:54 AM   #4
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 12

Original Poster
Rep: Reputation: 0
thanks eric
i found the option you say
but all of this take about n days
is there is something found the file changed in the last 2 hours

Last edited by hosney00ux; 08-25-2009 at 06:01 AM.
 
Old 08-25-2009, 05:54 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
You're welcome.
 
Old 08-25-2009, 06:17 AM   #6
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 12

Original Poster
Rep: Reputation: 0
thanks pwc101
 
Old 08-25-2009, 06:18 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by hosney00ux View Post
thanks eric
i found the option you say
but all of this take about n days
is there is something found the file changed in the last 2 hours
Several of the find command's tests work on minutes rather than days so you can test for files that are more than 119 minutes old.
 
Old 08-25-2009, 08:24 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
And if you know the possible location(s) of the file :

ls -tl <directory>

( see 'man ls' ).

.....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Question - Delete files in a dir older than 48 hours? t3___ Linux - Newbie 5 10-11-2011 04:42 AM
find command : finding files that are created within last 24 hours Fond_of_Opensource Linux - Newbie 1 11-06-2006 04:47 AM
Search only the last 24 hours files davholla Linux - General 1 04-13-2006 10:09 AM
Delete files after 24 hours Azhrarn Linux - Newbie 3 08-29-2005 01:00 PM
Deleting Files Older Than 2 Hours using Find? LinuxGeek Linux - Software 1 06-29-2005 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration