Posted By

stiobhart on 06/07/09


Tagged

server archive unix tar nix expand contract


Versions (?)

*nix - tar create and expand archives


 / Published in: Bash
 

commands for dealing with tar files

  1. # create:
  2. tar -cvzf <output filename> <directory>
  3.  
  4. # this means:
  5. # -c = create new archive
  6. # -v = be verbose
  7. # -z = compress using gzip
  8. # -f = filename to create for the new archive
  9.  
  10. # for the directory dinnae put "directory/*" just "directory" with no slash
  11. #
  12. # filenames should end in '.tar.gz' as they are tar'ed then zipped
  13. #
  14. # expand [on server]:
  15.  
  16. tar -xvf <filename>.tar.gz
  17.  
  18. # if it's a tar.bz2 archive, use the following:
  19.  
  20. tar -jxvf <filename>.tar.bz2

Report this snippet  

You need to login to post a comment.