*nix - tar create and expand archives


/ Published in: Bash
Save to your folder(s)

commands for dealing with tar files


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.