• MonkderVierte@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      6 hours ago
      $ time fd -t f locate /usr
      /usr/bin/fallocate
      /usr/include/clang/AST/ASTContextAllocate.h
      /usr/include/qt6/QtQmlCompiler/6.10.0/QtQmlCompiler/private/qresourcerelocater_p.h
      /usr/include/qt6/QtQml/6.10.0/QtQml/private/qlazilyallocated_p.h
      /usr/share/doc/libdc1394/html/structfw__cdev__allocate.html
      ...
      /usr/share/xml/docbook/xsl-stylesheets-1.79.2-nons/params/htmlhelp.button.locate.xml
      /usr/lib/ruby/gems/3.4.0/doc/racc-1.8.1/ri/Racc/Grammar/compute_locate-i.ri
      /usr/lib/ruby/gems/3.4.0/doc/racc-1.8.1/ri/Racc/Sym/locate-i.ri
      
      real	0m0.209s
      user	0m0.283s
      sys	0m0.663s
      

      Cut by me, because of qr size limit. fd is from here. Disk is NVME on PCIe3.

    • Meron35@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      15 hours ago

      plocate is much faster and requires less resources. macOS users should use mdfind instead

    • BeigeAgenda@lemmy.ca
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      22 hours ago

      Or like me obliviously spending cycles trawling through everything.

      find dir/ -iname "*John*Cena*"
      

      or

      grep -rIi "John.*Cena" dir/
      
      • MonkderVierte@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        obliviously spending cycles trawling through everything.

        Once vs. every time the db gets updated. Database for faster file searching is a HDD relict, imo.

          • SlurpingPus@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            7 hours ago

            Btw, while I’m here: you might also want to look into eza, fzf, bat, and maybe delta (or icdiff for side-by-side comparison). I’m pretty conservative regarding replacement for classic utils, but these are worth it.

          • SlurpingPus@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            10 hours ago

            They use different arguments, so unlikely. Though idk if there are wrappers or anything like that.

            They’re both easier to use and faster, so it’s worth making sure to switch.

      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        21 hours ago

        spending cycles trawling through everything

        Beats spending cycles indexing everything and never search them.

      • qjkxbmwvz@startrek.website
        link
        fedilink
        arrow-up
        2
        ·
        20 hours ago

        grep -rIi “John.*Cena” dir/

        I have this sort of thing aliased, with some added --include flags to filter file type (e.g., only match source/script files). Super useful!