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 04-09-2006, 06:51 PM   #1
Mike144
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
find and list files modified since system was booted


Hello

First time for me here.

I am having a problem finding and listing all of the files that have been created or modified in the /tmp directory since the system was last booted.

I know how to use the find command for a certain date or time but what command would I use to find and display the files since the last boot?

I need to setup a shell script with the command in it for a class assignment.

Thanks in advance.
 
Old 04-09-2006, 07:11 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
uptime will tell you how long the system has been running. You can access /proc/stat as well to get the boot time which maybe easier to parse in your script. dpending on how your doing it.
 
Old 04-09-2006, 07:20 PM   #3
Mike144
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the quick reply leonscape.

The problem is I don't know how to do it. The section of the assignment deals with the find command...here is the exact wording..

Heading of the section: Research on your Fedora Core 4 system to come up with sets of commands to accomplish the following tasks:

Here is the problem I'm having...

A listing of all files under the /tmp directory and it's sub directories that have been created or changed since the system was booted.

How I'm doing it is I'm not..I'm stuck. Any kick in the right direction would help. Better yet if you know of the simpliest way...I'll take that too.

Thanks again for your help.
 
Old 04-09-2006, 08:44 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
I'd suggest typing man find and searching for atime, ctime and mtime. I'd also suggest man uptime and man last (hint search for -x).

Then I'd search google with something like atime ctime mtime and have a look at sites like http://www.brandonhutchinson.com/ctime_atime_mtime.html to see what the terms mean.

Lastly, I'd suggest reading the forum rules about asking for specific help with homework...
 
Old 04-09-2006, 08:57 PM   #5
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
We need to calculate the number of minutes the system has been up, and feed that info to find.

Code:
#!/bin/bash
read upt idt << READ
    $( cat /proc/uptime )
READ
upt=$((${upt%%.*}/60))

find /tmp -type f -amin -$upt

Last edited by leonscape; 04-09-2006 at 08:58 PM.
 
Old 04-09-2006, 09:03 PM   #6
Mike144
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you both for your help.

As far as the homework issue.. oops! My frustration level exceeded my brains capacity.

I am trying to learn this stuff.. not just for homework but for a personal goal I set.

It took me 24 years to get back to school and my learning curve is a bit slow.

Thanks again for your help on this.
 
  


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
find today's modified files cranium2004 Linux - General 2 03-08-2006 10:24 PM
Downloading large files locks system up when booted off NFS edman007 Linux - Networking 3 02-26-2006 02:22 PM
Can I find links in the system that point to certain files throughout the system? HGeneAnthony Linux - Newbie 3 02-18-2005 09:28 AM
Security Warning: These files belonging to packages are modified on the system jmcollin92 Linux - Security 1 12-29-2003 07:16 AM
remove 'modified date' column in nautilus list view nexx_au Linux - Software 0 12-09-2003 04:29 AM

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

All times are GMT -5. The time now is 06:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration