Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


command to compress a folder in a Linux VPS(ubuntu) ?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

command to compress a folder in a Linux VPS(ubuntu) ?

rahulksrahulks Member
edited March 2013 in General

Anyone knows?

i want to download www(folder) inside /var

Comments

  • tar czf varwww.tar.gz /var/www
    tar cjf varwww tar.bz2 /var/www

    ?

  • rahulksrahulks Member
    edited March 2013

    I should type " tar czf varwww.tar.gz /var/www " right?
    why two cmds? diffrent formats?

  • jhjh Member

    The first creates a tar.gz, the second is an alternative format: .tar.bz2.

    There's also

    zip -r archive.zip /var/www

    for a .zip file

  • it says http://pokit.org/get/img/5261922876e4a48fbdd6e3cf178c3f72.jpg

    when i try

    zip -r archive.zip /var/www

  • jhjh Member
    edited March 2013
    yum -y install zip

    For CentOS
    or

    apt-get install zip

    Debian/Ubuntu

  • yea. tar -flag(s) the_compressed_file_name.tar.type /your/directory
    check here http://www.dslreports.com/faq/16175

  • stay outside of that folder and run below command

    $ tar pzcvf backupwww.tgz /var/www/

    p=with permissions

    z=gzip compression
    c=create
    v=verbose
    f=filename (backup.tgz)

  • Ok thanks guys and good night(i am from India,its night here).

  • @jhadley said: yum -y install zip

    For CentOS
    or

    apt-get install zip

    Debian/Ubuntu

    PS (For future readers). ZIP is limited to ~4GB of compressed data. tar would be a better option for larger files.

  • And bz2 offers a bit better compression than gz.

  • @mpkossen said: And bz2 offers a bit better compression than gz.

    there's also plzip and pbzip2 / lbzip2 for speed + compression ratios http://vbtechsupport.com/1614/ :)

  • hyaohyao Member

    If the folder is large, bz2 takes quite a bit longer to compress than gz.

  • @mnpeep said: PS (For future readers). ZIP is limited to ~4GB of compressed data. tar would be a better option for larger files.

    Not so much anymore, most linux OS switch to zip64 once it is bigger than 4GB. With zip64 it is ALOT more.

  • eva2000eva2000 Veteran
    edited March 2013

    @hyao said: If the folder is large, bz2 takes quite a bit longer to compress than gz.

    try lbzip2 easily 4-8x times faster than bz2 if you have more cpu threads to support lbzip2 :) But yes still slower than gzip and pigz

    http://vbtechsupport.com/1614/

  • Use rsync.

  • @Spencer said: Not so much anymore, most linux OS switch to zip64 once it is bigger than 4GB. With zip64 it is ALOT more.

    Do you know if zip64 is slower than regular zip?

  • Whats the cmd to extract a zip file by name "GameCPXioncube.zip" in debian 6 ?

  • RaymiiRaymii Member
    edited March 2013

    @rahulks

    You could also use google, it is faster...

    unzip GameCPXioncube.zip
    
  • Thanks

Sign In or Register to comment.