美文网首页
gunzip 和 unzip 解压文件到指定的目录

gunzip 和 unzip 解压文件到指定的目录

作者: mrknowledge | 来源:发表于2021-05-11 17:53 被阅读0次

gzip 命令:

# gzip test.txt

它会将文件压缩为文件 test.txt.gz,原来的文件则没有了,解压缩也一样

# gunzip test.txt.gz

它会将文件解压缩为文件 test.txt,原来的文件则没有了,为了保留原有的文件,我们可以加上 -c 选项并利用 linux 的重定向

# gzip -c test.txt > /root/test.gz

这样不但可以将原有的文件保留,而且可以将压缩包放到任何目录中,解压缩也一样

# gunzip -c /root/test.gz > ./test.txt

zip 命令:

# zip test.zip test.txt

它会将 test.txt 文件压缩为 test.zip ,当然也可以指定压缩包的目录,例如 /root/test.zip

# unzip test.zip

它会默认将文件解压到当前目录,如果要解压到指定目录,可以加上 -d 选项

# unzip test.zip -d /root/

相关文章

  • gunzip 和 unzip 解压文件到指定的目录

    gzip 命令: # gzip test.txt 它会将文件压缩为文件 test.txt.gz,原来的文件则没有了...

  • shell解压命令

    解压全部 gz文件:gunzip *g 解压zip文件: unzip xxx.zip 解压tar.gz文件:tar...

  • gunzip解压到指定目录

    gunzip -c file.gz > /THERE/filezcat is a shortcut for gun...

  • 批量解压zip

    利用shell命令for和unzip命令,批量解压查找当前目录下的zip文件,并创建zip同名目录,然后解压到目录

  • MAC下使用ngrok实现内网穿透

    下载MAC版的ngrok:https://ngrok.com/download 解压到指定目录:$ unzip -...

  • Linux 常用命令

    解压 unzip -o:是覆盖, -n:不覆盖,-t:检查是否损坏,-d:解压到指定目录 移动 mv

  • Linux下安装Fiddler

    安装 下载http://fiddler.wikidot.com/mono 解压cd到下载的目录unzip 文件名....

  • Linux 常用命令

    zip 压缩文件 unzip 解压缩文件 -d 指定减压缩的目录 -v 查看压缩包里的内容 df 报告系统空间信息...

  • 解压文件到指定目录

    下面的命令将文件解压到应用程序目录下。unzip xxx.zip -d /Applications

  • 6.Linux 压缩

    gzip/gunzip gzio用于压缩,gunzip用于解压 基本语法gzip 文件gunzip 文件.gz 实...

网友评论

      本文标题:gunzip 和 unzip 解压文件到指定的目录

      本文链接:https://www.haomeiwen.com/subject/ikdndltx.html