• Compressing with bzip2
  • L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




    Download 7,3 Mb.
    Pdf ko'rish
    bet106/125
    Sana14.05.2024
    Hajmi7,3 Mb.
    #232858
    1   ...   102   103   104   105   106   107   108   109   ...   125
    Bog'liq
    linuxbasicsforhackers

    Compressing with gzip
    Let’s try 
    gzip
    (GNU zip) first, as it is the most commonly used compression 
    utility in Linux. You can compress your HackersArise.tar file by entering the 
    following (making sure you’re in the directory that holds the archived file):
    kali >
    gzip HackersArise.*
    Notice that we used the wildcard 
    *
    for the file extension; this tells Linux 
    that the command should apply to any file that begins with HackersArise with 
    any file extension. You will use similar notation for the following examples. 
    When we do a long listing on the directory, we can see that HackersArise.tar
    has been replaced by HackersArise.tar.gz, and the file size has been com-
    pressed to just 3,299 bytes!
    kali >
    ls -l
    --
    snip
    --
    -rw-r--r-- 1 root root 3299 Nov 27 2018 13:32 HackersArise.tar.gz
    --
    snip
    --
    We can then decompress that same file by using the 
    gunzip
    command, 
    short for GNU unzip.


    Compressing and Archiving
    97
    kali >
    gunzip HackersArise.*
    Once uncompressed, the file is no longer saved with the .tar.gz exten-
    sion but with the .tar extension instead. Also, notice that it has returned to 
    its original size of 40,960 bytes. Try doing a long list to confirm this. 
    Compressing with bzip2
    Another of the other widely used compression utilities in Linux is 
    bzip2

    which works similarly to 
    gzip
    but has better compression ratios, mean-
    ing that the resulting file will be even smaller. You can compress your 
    HackersArise.tar file by entering the following:
    kali >
    bzip2 HackersArise.*
    When you do a long listing, you can see that 
    bzip2
    has compressed the 
    file down to just 2,081 bytes! Also note that the file extension is now .tar.bz2.
    To uncompress the compressed file, use 
    bunzip2
    , like so:
    kali >

    Download 7,3 Mb.
    1   ...   102   103   104   105   106   107   108   109   ...   125




    Download 7,3 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

    Download 7,3 Mb.
    Pdf ko'rish