LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   directory listings (http://www.linuxquestions.org/questions/linux-newbie-8/directory-listings-428975/)

aarulan 03-27-2006 09:15 AM

directory listings
 
How would i go about listing all files in the /tmp directory that have been created or modified since system boot time?
And a listing of all the files under the /var directory and its sub directories, that were created or modified within the last 7 days?

I tried working with the boot time in the bootlog, but not to sure how to go about it.

Again i would appreciate any help with these questions, Thanks!

Dragineez 03-27-2006 10:36 AM

Suggestions
 
I googled "date range linux ls" and came back with a few hits that should get you pointed in the right direction. Most suggestions have pointed to piping to awk or using find . -mtime. I'm sure one of those could be modified to suit your purposes.

ckoniecny 03-27-2006 11:12 AM

Code:

# find /var -mtime +20 -print  | xargs ls -l
This command will search /var for all files modified in the last 20 days. If you want to search what files were created in the last 20 days, just ctime instead of mtime in the find command.

aarulan 03-27-2006 04:23 PM

do you know where i can find the boot time? I tried looking in the boot log, but on one of my systems the file it empty, and on another its got the time, but i cant isolate it? is there a better location i should be looking in for the time stamp?

Thanks!

Dragineez 03-27-2006 07:49 PM

Roll Your Own
 
How about putting a line in your /etc/bootmisc.sh to write a boot time token that you can use for that purpose?

I'm sure that's not even necessary, there are tons of "up time" counters so it must be getting the boot time from somewhere - but...

Idunno :scratch:


All times are GMT -5. The time now is 09:15 AM.