(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43410692

这个 Hacker News 帖子讨论了 `fd`,一个比 `find` 命令更快、更友好的替代品。一位用户 `snide` 称赞了 `fd`,并鼓励其他高薪工程师为像 sharkdp 这样的开源开发者提供经济支持,强调这会对互联网生态系统产生积极影响。另一位用户 `tucnak` 分享了他使用的别名:`fd="rg --files | rg"`。 然而,`oguz-ismail` 对 `fd` 的 UTF-8 假设提出了担忧,这在处理包含非 UTF-8 字符的文件名时可能会导致错误。他们用名为 "a.\xFF" 的文件和土耳其语言环境的例子演示了这个问题。他们解释说 `fd` 假设参数是 UTF-8 编码的,而文件名并不总是限于这种编码。`coldpie` 要求更详细地说明这个问题,`oguz-ismail` 对原因进行了澄清。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
fd: A simple, fast and user-friendly alternative to 'find' (github.com/sharkdp)
45 points by tosh 2 hours ago | hide | past | favorite | 5 comments










Big sharkdp fan. Ty you for making awesome software that i use DAILY.

bat, fd, hexyl, hyperfine

I'm going to take this moment to remind all of you well-paid engineers that if we each spread $10 a month sponsoring talented software makers like sharkdp the Internet would be a better place.

So many great little tools out there and we should try to support an ecosystem for them.



    alias fd="rg --files | rg"


    $ touch $'a.\xFF'
    $ find -name $'*.\xFF'
    ./a.?
    $ ./fd -e $'\xFF'
    error: invalid UTF-8 was detected in one or more arguments

    Usage: fd [OPTIONS] [pattern] [path]...

    For more information, try '--help'.
    $
    $ touch III
    $ LC_ALL=tr_TR.UTF-8 find -iname 'iii'
    $ LC_ALL=tr_TR.UTF-8 ./fd 'iii'
    III
    $
Every fucking time


Can you elaborate on what's going on here? Something like "fd" is assuming your filenames are UTF-8, but you're actually using some other encoding?


fd is assuming my arguments are UTF-8 while filenames can contain any byte but NUL and /






Join us for AI Startup School this June 16-17 in San Francisco!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com