‹ BackHN Continuity

Thread

Small programming tricks

681 points · 294 comments · signa11

  1. IsTom · · focus · HN ↗
    `find` does a lot more things than that.
    1. laweijfmvo · · focus · HN ↗
      Definitely. The whole Unix philosophy of each command doing one thing and being easily composable always seemed to break down in my mind when it came to find. find does a lot.

      similar to ripgrep, though, fd is a modern replacement that’s a bit friendlier to use.

      1. jimmaswell · · focus · HN ↗
        find is absolute agony once you get a taste of fd.
        1. internet_points · · focus · HN ↗
          I tried fd but it seems to ignore so much that it's basically useless. If I wanted `git ls-files|grep` I would `git ls-files|grep`

          yells at cloud

          ..it's probably ok actually and I should give it a real go, but I'm too used to find and even have a keybinding in my ~/.inputrc to insert a find + where loop

              "\e\C-f": "find . -type f -print0|while read -rd '' f; do ; done\e-b\C-b\C-b\C-b\C-b\C-b\C-b"
          
          (yes I know about -exec; I find the loop easier to work with)
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.