LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 04:28 AM   #1
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 13

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 04:35 AM.
 
Old 08-25-2009, 04: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: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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, 04: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, 04:54 AM   #4
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 13

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 05:01 AM.
 
Old 08-25-2009, 04: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: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
You're welcome.
 
Old 08-25-2009, 05:17 AM   #6
hosney00ux
LQ Newbie
 
Registered: Jul 2009
Location: Egypt
Posts: 13

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

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 07:24 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

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

ls -tl <directory>

( see 'man ls' ).

.....
 
  


Reply



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 03:42 AM
find command : finding files that are created within last 24 hours Fond_of_Opensource Linux - Newbie 1 11-06-2006 03:47 AM
Search only the last 24 hours files davholla Linux - General 1 04-13-2006 09:09 AM
Delete files after 24 hours Azhrarn Linux - Newbie 3 08-29-2005 12:00 PM
Deleting Files Older Than 2 Hours using Find? LinuxGeek Linux - Software 1 06-29-2005 06:10 AM

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

All times are GMT -5. The time now is 01:28 AM.

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
Open Source Consulting | Domain Registration