• Compressing Files
  • 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
    bet105/125
    Sana14.05.2024
    Hajmi7,3 Mb.
    #232858
    1   ...   101   102   103   104   105   106   107   108   ...   125
    Bog'liq
    linuxbasicsforhackers

    tar -tvf HackersArise.tar
    -rwxr-xr-x 1 root root 22311 Nov 27 2018 13:00 hackersarise1.sh
    -rwxr-xr-x 1 root root 8791 Nov 27 2018 13:00 hackersarise2.sh
    -rwxr-xr-x 1 root root 3992 Nov 27 2018 13:00 hackersarise3.sh
    Here, we see our three original files and their original sizes. You can 
    then extract those files from the tarball using the 
    tar
    command with the 
    -x
    (extract) switch, as shown next:
    kali >
    tar -xvf HackersArise.tar
    hackersarise1.sh
    hackersarise2.sh
    hackersarise3.sh
    Because you’re still using the 
    –v
    switch, this command will show which 
    files are being extracted in the output. If you want to extract the files 
    and do so “silently,” meaning without showing any output, you can simply 
    remove the 
    -v
    (verbose) switch, as shown here:
    kali >
    tar -xf HackersArise.tar


    96
    Chapter 9
    The files have been extracted into the current directory; you can do 
    a long listing on the directory to double-check. Note that by default, if an 
    extracted file already exists, 
    tar
    will remove the existing file and replace it 
    with the extracted file.
    Compressing Files
    Now we have one archived file, but that file is bigger than the sum of the 
    original files. What if you want to compress those files for ease of transport? 
    Linux has several commands capable of creating compressed files. We will 
    look at these:
    • 
    gzip
    , which uses the extension .tar.gz or .tgz
    • 
    bzip2
    , which uses the extension .tar.bz2
    • 
    compress
    , which uses the extension .tar.z
    These all are capable of compressing our files, but they use different 
    compression algorithms and have different compression ratios. Therefore, 
    we’ll look at each one and what it’s capable of.
    In general, 
    compress
    is the fastest, but the resultant files are larger; 
    bzip2
    is the slowest, but the resultant files are the smallest; and 
    gzip
    falls some-
    where in between. The main reason you, as a budding hacker, should know 
    all three methods is that when accessing other tools, you will run into vari-
    ous types of compression. Therefore, this section shows you how to deal 
    with the main methods of compression.

    Download 7,3 Mb.
    1   ...   101   102   103   104   105   106   107   108   ...   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