willx8
V2EX  ›  macOS

os x 终端的 find 的小问题……

  •  
  •   willx8 · Apr 7, 2016 · 1836 views
    This topic created in 3731 days ago, the information mentioned may be changed or developed.
    随便找个目录
    linux 下
    > find . -name xxx

    > find ./ -name xxx
    的输出是一样的
    ./xxx

    os x 的终端,如果用
    > find . -name xxx
    输出是正常的
    但是如果用
    > find ./ -name xxx
    找的文件是一样的,但是输出会是
    .//xxx

    多了一个 /,看着好难过啊……
    4 replies    2016-04-15 06:58:27 +08:00
    liuyanjun0826
        1
    liuyanjun0826  
       Apr 8, 2016
    确实如此,我想 OS X 是对的,.代表当前目录,多一个 /代表多余的符号, find .// -name xxx 也会输出.///xxx
    lovedebug
        2
    lovedebug  
       Apr 8, 2016
    可以全部换装 linux 版命令行, 感觉还不错
    参看: https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
    rushcheyo
        3
    rushcheyo  
       Apr 14, 2016
    @liuyanjun0826 BSD 犯的愚蠢的错误都能归结到 OS X 设计好上,被你们折服了。
    liuyanjun0826
        4
    liuyanjun0826  
       Apr 15, 2016
    @rushcheyo 请教 DNS 设置是否有可能导致外置硬盘丢失?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1089 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:03 · PVG 07:03 · LAX 16:03 · JFK 19:03
    ♥ Do have faith in what you're doing.