fd icon indicating copy to clipboard operation
fd copied to clipboard

Cannot use the -p flag to filter out directories through regex

Open gamife opened this issue 2 years ago • 2 comments

What version of fd are you using? fd --version fd 8.4.0

When I use the -p flag to search a directory by regular matching, the .*/$ expression does not take effect. But the directories in the return result end in / (e.g.: dir/), which confused me.

gamife avatar Aug 30 '22 08:08 gamife

The "/" at the end is not actually part of the path. It is added on to the output as a way of indicating that the entry is a directory.

tmccombs avatar Aug 31 '22 05:08 tmccombs

You can, however, use --type directory (or -td in short) to only match on directories.

sharkdp avatar Aug 31 '22 06:08 sharkdp

I'm going to close this, because I don't think there is anything that needs to be done here.

tmccombs avatar Nov 15 '22 04:11 tmccombs