Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make the output of fd print only once for each file it finded? #405

Closed
explainlikeimfive opened this issue Feb 9, 2019 · 1 comment
Labels

Comments

@explainlikeimfive
Copy link

E.g. for files that respect [pattern] in current directory, $ fd [pattern] . . . will print each of them 3 times. How to make it print only once?

@sharkdp
Copy link
Owner

sharkdp commented Feb 9, 2019

There is currently no way to do this directly in fd, but you can simply pipe into sort -u:

fd [pattern] some/ search/ paths/ | sort -u

If you want to keep the colored output, you need to use --color=always:

fd --color=always [pattern] some/ search/ paths/ | sort -u

sharkdp added a commit that referenced this issue Apr 2, 2020
Add a new `-l`/`--list` option to show more details about the search results. This is basically
an alias for `--exec-batch ls -l` with some additional `ls` options.
This can be used in order to:
    * see metadata like permissions, owner, file size, modification times (#491)
    * see symlink targets (#482)
    * achieve a determinstic output order (#324, #196, #159)
    * avoid duplicate search results when multiple search paths are given (#405)
sharkdp added a commit that referenced this issue Apr 2, 2020
Add a new `-l`/`--list` option to show more details about the search results. This is basically
an alias for `--exec-batch ls -l` with some additional `ls` options.
This can be used in order to:
    * see metadata like permissions, owner, file size, modification times (#491)
    * see symlink targets (#482)
    * achieve a deterministic output order (#324, #196, #159)
    * avoid duplicate search results when multiple search paths are given (#405)
sharkdp added a commit that referenced this issue Apr 3, 2020
Add a new `-l`/`--list` option to show more details about the search results. This is basically
an alias for `--exec-batch ls -l` with some additional `ls` options.
This can be used in order to:
    * see metadata like permissions, owner, file size, modification times (#491)
    * see symlink targets (#482)
    * achieve a deterministic output order (#324, #196, #159)
    * avoid duplicate search results when multiple search paths are given (#405)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants