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

Show symlink target? #482

Closed
wpcarro opened this issue Sep 16, 2019 · 11 comments · Fixed by #556
Closed

Show symlink target? #482

wpcarro opened this issue Sep 16, 2019 · 11 comments · Fixed by #556
Assignees
Milestone

Comments

@wpcarro
Copy link

wpcarro commented Sep 16, 2019

Thanks for making fd. I love it and I've been using it heavily for about a year.

I was wondering if it was possible to display the targets of symlinks for commands like:

fd --type l

I couldn't find anything in the documentation about this, but it would be a nice addition.

@tmccombs
Copy link
Collaborator

I think you could do that with --exec readlink or similar

@wpcarro
Copy link
Author

wpcarro commented Sep 16, 2019

Thanks. I didn't know about exec.

I still think it might be nice to support it internally and not via exec. The syntax coloring of links is nice and a view like target -> source could be useful for some people.

@sharkdp
Copy link
Owner

sharkdp commented Sep 18, 2019

Thank you for the feedback.

I kind of like the idea, but it should be discussed first.

It would certainly only be enabled in "interactive" mode (when not piping the output elsewhere).

I see one obvious disadvantage of this behavior. If someone wants to "copy & paste" a list of found files from fds output, it would also include the … -> source part.

@danielecook
Copy link

I would like to vote for this feature. I use fd to track down sequencing data which is unfortunately symlinked often making it difficult to get the absolute paths and a unique set of files. If there was an option to resolve symlinked paths to their real paths that is faster than --exec readlink I would very much appreciate it.

@sharkdp
Copy link
Owner

sharkdp commented Oct 6, 2019

see also: #491

@sharkdp sharkdp self-assigned this Apr 2, 2020
@sharkdp sharkdp added this to the v8.0 milestone Apr 2, 2020
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)
@sharkdp
Copy link
Owner

sharkdp commented Apr 3, 2020

In #556, I have implemented a new -l/--list-details option which can be used to show symlink targets:

image

@wpcarro @danielecook I hope that's fine for your use case.

@wpcarro
Copy link
Author

wpcarro commented Apr 3, 2020

This fits my use-case exactly. Thank you, @sharkdp

@sharkdp
Copy link
Owner

sharkdp commented Apr 16, 2020

This has now been released in fd v8.0.

@laoshaw
Copy link

laoshaw commented Sep 1, 2020

so my .gitignore ignores a few build temporary dirs, but I need find files there once a file, fd will quietly ignore them, and I have to return to 'find'.

is there a way to set a local file that has higher priority than .gitignore, say .gitfd, that once it's there, fd will prefer it to .gitignore.

.gitignore is for git to manage code(commit or not), but fd should do more, and could we have a way to do that like described above?

@tmccombs
Copy link
Collaborator

tmccombs commented Sep 1, 2020

@laoshaw you tell fd to ignore the .gitignore file altogether with the --no-ignore-vcs option.

If you just want exceptions to .gitignore, you can add a negated rule to your .fdignore file. So, say if you have foo/ in your .gitignore, you could put !foo/ in you .fdignore to add it back to fd searches.

But also, what does this have to do with showing symlink targets?

@laoshaw
Copy link

laoshaw commented Sep 1, 2020

That works. Nothing to do with symlink, it's when I could not find the symlinks in a directory I first thought it's because fd can not do symlinks, then realized it's because of .gitignore has that directory. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants