LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 12: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, 12: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, 12: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, 05:52 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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



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 all users in system ALInux Linux - Newbie 27 04-17-2018 02:59 AM
HowTo List Newly Installed Program GNewbie MEPIS 2 11-23-2005 02:55 PM
HowTo add specific location into sources.list? Mathsniper Debian 1 08-28-2005 04:21 AM
Most efficient way to list files changed since a specific time dman65 Linux - General 4 04-07-2005 12:52 PM
DISCUSSION: Howto stop your laptop from crashing when power source is changed. bufo333 LinuxAnswers Discussion 1 07-24-2004 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:10 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