fd: match full path
β’ 72 words β’ 1 min β’ updated
β οΈ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.
When using fd(1), only the filename is
matched by default.
To match the full path, use -p. It is often useful to combine it with --type file.
shell
% fd -p clustermon --type file
apps/base/clustermon/clustermon.yaml
apps/base/clustermon/kustomization.yaml
apps/overlays/g02/clustermon/patches.yaml
apps/overlays/g02/clustermon/values.yamlA natural extension is to pipe it to | ifne xargs -n 1 gsed -i -e '{expression}'. Changes in the entire codebase at your fingertips!
Update(2025-11-30): We can use xargs -r instead of ifne.