Skip to content

Porting macOS aliases from find to fd #1615

Answered by tavianator
shamindras asked this question in Q&A
Discussion options

You must be logged in to vote

Yet when I run fd '\.(DS_Store|swo|swp)$|~$' -d1 or fd '\.(DS_Store|swo|swp)$|~$', I don't seem to get any matches. Did I make a mistake here?

You probably want to add fd -u to include hidden files and .gitignored files. Also note that the -d1/--max-depth=1 is in effect, remove that for wash.

Also how does your regex ensure, for example, that we match *.swo (desired) and not just .swo (without the wildcard prefix, i.e., undesired)?

fd's regexes are not anchored, so fd X is just like fd '.*X'.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@shamindras
Comment options

@tavianator
Comment options

Answer selected by shamindras
@shamindras
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants