Author Topic: Duh... moment of the day  (Read 2309 times)

Dumah

  • Jackass IV
  • Posts: 960
  • Karma: +21/-6
Duh... moment of the day
« on: September 05, 2008, 02:32:44 PM »
Ever have a problem with software where it just wont do what its supposed to do and you cant work out why?

I've been doing a little scripting and had to pull up a list of what files were accessed in the last 10 minutes. So I knock up a little script that relies on the *nix "find" command, kind of like

Quote
find /usr -amin 10

 - basically, what files in the usr directory were accessed in tha last 10 minutes. Now whatever I did it just wouldnt work, sometimes it gave results, but usually it found nothing. I tried to touch some files, create new ones, modify some of them, but no results.

Then, after 30 minutes of messing about I realised i missed the minus sign before the 10.

Quote
find /usr -amin -10

Now it works fine...DOH...

Perspective

  • badfish
  • Jackass In Charge
  • Posts: 4635
  • Karma: +64/-22
    • http://jeff.bagu.org
Re: Duh... moment of the day
« Reply #1 on: September 05, 2008, 02:37:06 PM »
You mean the first command wouldn't tell you all of the files that are going to be modified in the next 10 minutes? :p

Dumah

  • Jackass IV
  • Posts: 960
  • Karma: +21/-6
Re: Duh... moment of the day
« Reply #2 on: September 05, 2008, 02:59:31 PM »
I guess so...strangely I did get some results for firefox & thunderbird when I ran it for my home directory, so I guess they have a tendancy to mark files for future access  :dunno:

Dumah

  • Jackass IV
  • Posts: 960
  • Karma: +21/-6
Re: Duh... moment of the day
« Reply #3 on: September 05, 2008, 04:39:58 PM »
Just for info, no minus means exactly that amount of minutes (minus less than, plus greater than)