{eval=Array;=+count(Array);}

问答专栏Q & A COLUMN

linux打包成zip

edagarliedagarli 回答1 收藏2
问题描述:linux打包成zip
收藏问题

1条回答

winterdawn

winterdawn

回答于2023-04-25 10:52

To create a zip archive of a directory or file in Linux, you can use the following command:
zip -r archive_name.zip directory_or_file_path
For example, if you want to create a zip archive of a directory called `my_directory`, you can run the following command:
zip -r my_directory.zip my_directory
The `-r` option tells the `zip` command to recursively include all subdirectories and files within the specified directory. If you want to include multiple directories or files in the same archive, you can list them all as separate arguments to the `zip` command:
zip -r archive_name.zip directory1 directory2 file1.txt file2.txt
This will create an archive called `archive_name.zip` that includes `directory1`, `directory2`, `file1.txt`, and `file2.txt`. Note that the `zip` command may not be installed on your Linux system by default. If you get a "command not found" error when running the `zip` command, you can install it by running:
sudo apt-get install zip
or
sudo yum install zip
depending on your Linux distribution.
评论0 赞同0
  •  加载中...

相关问题

最新活动

您已邀请0人回答 查看邀请

我的邀请列表

  • 擅长该话题
  • 回答过该话题
  • 我关注的人
向帮助了您的网友说句感谢的话吧!
付费偷看金额在0.1-10元之间
<