Linux CentOS 6 解压缩文件,但文件将转到根文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15009314/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 19:05:28  来源:igfitidea点击:

CentOS 6 unzip file but files are going to root folder instead

linuxcentoscentos6

提问by Jony kale

When I did

当我做

unzip /var/www/html/web.zip 

It unzipped the zip to /root/ folder. I need it to unzip the files to /var/www/html/

它将 zip 解压缩到 /root/ 文件夹。我需要它将文件解压缩到 /var/www/html/

why is it happening?

为什么会这样?

CentOS 6.3 64bit

CentOS 6.3 64 位

采纳答案by piokuc

Do:

做:

cd /var/www/html/
unzip web.zip

回答by Milad.Nozari

try this:

尝试这个:

unzip /var/www/html/web.zip -d /var/www/html/

your command extracts the archive content to the current directory. you can check if your in /root using the following command

您的命令将存档内容提取到当前目录。您可以使用以下命令检查您是否在 /root 中

pwd

回答by ASR

To learn more about unzip, you can try running below command. this will return you all options possible with unzip

要了解有关解压缩的更多信息,您可以尝试运行以下命令。这将返回您所有可能的选项unzip

unzip -man

unzip -man