Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 public_html 文件夹压缩到排除两个文件夹,如下所示:
tar -czf myzip.tar.gz --exclude=home/mydomain/public_html/folder0 --exclude=home/zeejfl6/folder1 /home/mydomain/public_html/
但我得到了错误:
tar: Removing leading `/' from member names
我尝试了一些组合......我做错了什么?
这不是错误,而是警告。
包含文件绝对路径的档案存在安全风险。想象一个包含/etc/passwd.
/etc/passwd
如果您坚持在存档中包含绝对路径,请使用以下-P选项:
-P
-P, --absolute-names don't strip leading `/'s from file names