V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
willx8
V2EX  ›  macOS

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

  •  
  •   willx8 · 2016-04-07 23:14:33 +08:00 · 1349 次点击
    这是一个创建于 2947 天前的主题,其中的信息可能已经有所发展或是发生改变。
    随便找个目录
    linux 下
    > find . -name xxx

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

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

    多了一个 /,看着好难过啊……
    4 条回复    2016-04-15 06:58:27 +08:00
    liuyanjun0826
        1
    liuyanjun0826  
       2016-04-08 03:47:30 +08:00
    确实如此,我想 OS X 是对的,.代表当前目录,多一个 /代表多余的符号, find .// -name xxx 也会输出.///xxx
    lovedebug
        2
    lovedebug  
       2016-04-08 13:46:33 +08:00
    可以全部换装 linux 版命令行, 感觉还不错
    参看: https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
    rushcheyo
        3
    rushcheyo  
       2016-04-14 18:03:09 +08:00
    @liuyanjun0826 BSD 犯的愚蠢的错误都能归结到 OS X 设计好上,被你们折服了。
    liuyanjun0826
        4
    liuyanjun0826  
       2016-04-15 06:58:27 +08:00
    @rushcheyo 请教 DNS 设置是否有可能导致外置硬盘丢失?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2220 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 02:50 · PVG 10:50 · LAX 19:50 · JFK 22:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.