zxia10x
V2EX  ›  问与答

linux下打包怎么忽略所有隐藏目录?

  •  1
     
  •   zxia10x · Sep 1, 2013 · 3542 views
    This topic created in 4681 days ago, the information mentioned may be changed or developed.
    4 replies    1970-01-01 08:00:00 +08:00
    pright
        1
    pright  
       Sep 1, 2013
    find foo -type d -name '.*' > exclude
    tar cvfX foo.gz exclude foo
    wang2191195
        2
    wang2191195  
       Sep 1, 2013
    tar -c --exclude '.*' -f - $SRC | gzip > $DEST
    pright
        3
    pright  
       Sep 1, 2013
    @wang2191195 这样dot files也会排除的
    wang2191195
        4
    wang2191195  
       Sep 1, 2013
    @pright =.= 嗯 没注意看是隐藏所有目录。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    ♥ Do have faith in what you're doing.