Comments (3)
By default, fd
is just comparing the file name (e.g. index.js
) to the glob. It seems a bit strange that **/*.js
matches at all, but it happens to work because recursive globs like **/*
will also match top level files (see https://docs.rs/globset/latest/globset/#syntax).
You can turn on --full-path
but then the matching is against the full absolute path (see #839)
$ fd --full-path -g 'hello/**/*.js' # Probably no results
$ fd --full-path -g "$PWD/hello/**/*.js"
hello/world/index.js
from fd.
I think this answers my question. Thanks!
from fd.
It may be worth printing a warning if a glob includes /
without --full-path
. GNU find does:
$ find -name 'foo/bar'
find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time. Did you mean ‘-wholename’?
from fd.
Related Issues (20)
- [BUG] `-e` overrides `--no-follow` behavior and includes symlinks into results HOT 1
- More ways to anchor patterns HOT 5
- Please provide a statically linked aarch64 version HOT 5
- [BUG] Full-path search and globbing leads to `fd` not exit on pipeline closing HOT 5
- [BUG] Installation failed on macOs HOT 3
- [BUG] --list-details fail on windows ( missing ls error ) while using nushell that has ls exposed HOT 1
- [BUG] `--full-path` doesn't interpret with regexp `^` pattern HOT 2
- Shouldn't fd support using ~ as a subtitute for the home directory when writing paths? HOT 1
- List all directories in cwd, including '.' and '..' HOT 2
- Support timestamp in the format @%s (seconds since epoch) like GNU date HOT 1
- fdexclude/exclude configuration file, similar to fdignore/ignore configuration file HOT 2
- Adding an output mode with network-absolute paths HOT 2
- Filter files based on command output HOT 1
- [BUG] Incorrect application of `.gitignore` rules when using `fd` from a nested directory HOT 3
- Add clippy check to github actions CI HOT 2
- [BUG] Wrong result when --full-path and .. HOT 3
- `--all` argument HOT 2
- Ignore top level .gitignore HOT 3
- Chinese version of fd project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fd.