Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
jackpot
V2EX  ›  Linux

命令行请教下,老哥们!

  •  
  •   jackpot · May 25, 2020 · 4195 views
    This topic created in 2184 days ago, the information mentioned may be changed or developed.

    前人留下的脚本文件有这么一行 rm -rf -- ./cache/* 其中的--是什么意思啊?单个-我知道是前一工作目录,两个--是个啥啊?

    4 replies    2020-05-28 19:50:19 +08:00
    PTLin
        2
    PTLin  
       May 25, 2020
    假如你有个文件是-开头的,比如-foo,想删除的话可以 rm -- -foo,或者 rm ./-foo 。而且这个东西 man 里都写了。。。
    ungrown
        3
    ungrown  
       May 27, 2020
    双横杠意思是“option 到此为止”,后面的都不是 option,也不会被解析成 option
    jackpot
        4
    jackpot  
    OP
       May 28, 2020 via Android
    哦哦理解了,谢谢老哥们,抱拳!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   936 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:57 · PVG 04:57 · LAX 13:57 · JFK 16:57
    ♥ Do have faith in what you're doing.