• BeigeAgenda@lemmy.ca
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    25 天前

    Or like me obliviously spending cycles trawling through everything.

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

    or

    grep -rIi "John.*Cena" dir/
    
    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      25 天前

      spending cycles trawling through everything

      Beats spending cycles indexing everything and never search them.

    • qjkxbmwvz@startrek.website
      link
      fedilink
      arrow-up
      2
      ·
      24 天前

      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!

    • MonkderVierte@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      24 天前

      obliviously spending cycles trawling through everything.

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

        • [object Object]@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          24 天前

          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.

        • [object Object]@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          24 天前

          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.