zoukankan      html  css  js  c++  java
  • 命令行 | File Compression in Linux

    Compress an Entire Directory or a Single File

    Use the following command to compress an entire directory or a single file on Linux. It’ll also compress every other directory inside a directory you specify–in other words, it works recursively.

    tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

    Here’s what those switches actually mean:

    • -c: Create an archive.
    • -z: Compress the archive with gzip.
    • -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
    • -f: Allows you to specify the filename of the archive.

    Let’s say you have a directory named “stuff” in the current directory and you want to save it to a file named archive.tar.gz. You’d run the following command:

    tar -czvf archive.tar.gz stuff

    Or, let’s say there’s a directory at /usr/local/something on the current system and you want to compress it to a file named archive.tar.gz. You’d run the following command:

    tar -czvf archive.tar.gz /usr/local/something

  • 相关阅读:
    API响应
    利用postman 实现Get和Post测试
    Postman 使用详解
    斐讯K2 22.5.9固件刷华硕固件实测教程
    Python多线程
    Ubuntu 16.04 上安装 MySQL 5.7 教程
    python 实战爬虫项目,学会这个32个项目天下无敌
    目录
    zip 下载解压
    滑动
  • 原文地址:https://www.cnblogs.com/casperwin/p/6847932.html
Copyright © 2011-2022 走看看