LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-18-2005, 01:11 PM   #1
MicroSun
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
Howto list last changed files


Hello,

how is it possible to list all files on a PC which was modified in the last 5 minutes?
I want to check which files are written with various tools.
(I use Debian Sarge)

Thanks!
 
Old 02-18-2005, 01:17 PM   #2
JediGuy_bob
LQ Newbie
 
Registered: Apr 2004
Location: Albuquerque/Chicago
Posts: 22

Rep: Reputation: 15
ls -lt

it will list files in order of most recently modified. Pipe it to head:

ls -lt|head

to get only the ten most recent files. Do this if you are in the directory otherwise do this:

ls -lt /foo/bar|head
 
Old 02-18-2005, 01:47 PM   #3
MicroSun
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks, but what can I do if I don't know the directory?
I want to check all files in the filesystem and not only in one directory.
 
Old 02-18-2005, 06:52 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
The find command has a ctime option that you can use.
To locate all files modified the last 5 minutes:
find / -cmin -5

If you have other filesystems mounted, then you might want to use the -mount option so that places like /mnt/cdrom aren't searched. On some systems this opton is called -xdev instead.

find / -mount -cmin -5

Also, you might want to do this as root, because several directories can't be searched by a regular user, and this will result in a large number of error messages if you don't redirect stderr to /dev/null. ( 2>/dev/null )
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HowTo List Newly Installed Program GNewbie MEPIS 2 11-23-2005 03:55 PM
HowTo list all users in system ALInux Linux - Newbie 22 11-23-2005 04:50 AM
HowTo add specific location into sources.list? Mathsniper Debian 1 08-28-2005 05:21 AM
Most efficient way to list files changed since a specific time dman65 Linux - General 4 04-07-2005 01:52 PM
DISCUSSION: Howto stop your laptop from crashing when power source is changed. bufo333 LinuxAnswers Discussion 1 07-24-2004 04:11 PM


All times are GMT -5. The time now is 06:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration