Quantcast
Channel: Why is [find] running incredible fast, if run twice? - Super User
Viewing all articles
Browse latest Browse all 2

Why is [find] running incredible fast, if run twice?

$
0
0

In the Dash of my Ubuntu/Linux system are two versions of the same program.

Initial Problem

To find where the corresponding .desktop files are located I used

find / -type f -name 'Sublime Text.desktop' 2> /dev/null

I got zero hits, so I did (with success)

find / -type f -name '[s,S]ublime*.desktop' 2> /dev/null

I was amazed as I saw, that it finished after about three seconds, as the search term should be significant lager than the first one. As it was not quiet kosher to me, I ran the first command again and to my surprise now it took only about three seconds to finish too.

To verify the behaviour I powered up a second Linux box and ran the first command again, but this time with time

time find -type f -name 'Sublime Text.desktop' 2> /dev/null 

Proof


find does not only speed up the search of the same search term, but rather all searches (within the same path?).Even the search for an "unreleated" String is not slowed down.

time find / -type f -name 'Emilbus Txet.Potksed' 2> /dev/null

Analyse RAM while before and after using find

What does find do to speed the search process up so insanely?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images