Skip to content

Instantly share code, notes, and snippets.

@pmcpsantana
Forked from haskaalo/tarcheatsheet.md
Created April 26, 2020 06:03
Show Gist options
  • Select an option

  • Save pmcpsantana/b20ae5cd5896ce9ed96fb63ab0c3d947 to your computer and use it in GitHub Desktop.

Select an option

Save pmcpsantana/b20ae5cd5896ce9ed96fb63ab0c3d947 to your computer and use it in GitHub Desktop.

Revisions

  1. @haskaalo haskaalo revised this gist Jun 20, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tarcheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ e.g: `tar -czvf name-of-archive.tar.gz /path/to/directory-or-file`

    * -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.
    * -v: makes tar talk a lot. Verbose output shows you all the files being archived and much.
    * -f: Allows you to specify the filename of the archive.

    ## Extract an Archive
  2. @haskaalo haskaalo created this gist Jun 20, 2017.
    20 changes: 20 additions & 0 deletions tarcheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Tar Usage / Cheat Sheet

    ## Compress a file or directory

    e.g: `tar -czvf name-of-archive.tar.gz /path/to/directory-or-file`

    * -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.

    ## Extract an Archive

    e.g: `tar -xvzf name-of-archive.tar.gz`


    * f: this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file.
    * z: tells tar to decompress the archive using gzip
    * x: tar can collect files or extract them. x does the latter.
    * v: makes tar talk a lot. Verbose output shows you all the files being extracted.