Geek.Like.Todd

Extract / Compress Cheat Sheet Part 1 —

In Linux / Unix you get alot of compressed files.. and I’m too old to remember how to compress or extract sometimes.. but thats what Google is for right??

tar
To Make:
tar -cvf foo.tar /foldertoarchive
To Extract:
tar -xf foo.tar

tar.gz
It’s worth mentioning that if you already have a tar file, you can use gzip to make it a tar.gz with:
gzip foo.tar
But you can do both with:
tar -cvzf foo.tar.gz /foldertoarchive
To Extract:
tar -zxvf foo.tar.gz

tar.bz2
tar.bz2 has a real good compression ratio, but takes longer to create, which for me is fine tbh.
To Make:
tar -cvjf foo.tar.bz2 /foldertoarchive
To Extract:
tar -jxvf foo.tar.bz2


0

Categorised as: Linux



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.