Fd: Search in Files

Created on 11 Oct 2017  路  2Comments  路  Source: sharkdp/fd

I would be really awesome to have a feature to search text inside files.

question

Most helpful comment

You may need ripgrep. E.g. rg ---files-with-matches -0 PATTERN [path]...

All 2 comments

You may need ripgrep. E.g. rg ---files-with-matches -0 PATTERN [path]...

Yes, there are other tools that are designed for this purpose (like ripgrep, grep, ag, etc.).

If you have already built a search query in fd, you can still use xargs to search exactly these files:

> fd -e rs '^[am]' 
src/app.rs
src/fshelper/mod.rs
src/lscolors/mod.rs
src/main.rs
tests/testenv/mod.rs

> fd -e rs '^[am]' | xargs grep 'fn main'
src/main.rs:fn main() {
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrzool picture mrzool  路  4Comments

blueray453 picture blueray453  路  3Comments

sharkdp picture sharkdp  路  3Comments

hungptit picture hungptit  路  3Comments

longcp picture longcp  路  3Comments