Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding tar, gzip, bzip2, zip #14

Closed
jgraup opened this issue Nov 23, 2015 · 1 comment
Closed

Consider adding tar, gzip, bzip2, zip #14

jgraup opened this issue Nov 23, 2015 · 1 comment

Comments

@jgraup
Copy link

jgraup commented Nov 23, 2015

Command Description
tar -zcvf [.tgz-file] [files] Zip files with gzip compression
tar -jcvf [.tbz2-file] [files] Zip files with bzip2 compression
gzip -f -9 [file] Zip file
tar -zxvf [.tgz-file] Decompress file
tar -jxvf [.tbz2-file] Decompress file

Examples

Compress

timestamp=`date +%Y-%m-%d`
tar -zcvf archive.$timestamp.tar.gz myFolder
tar -zcvf data.tgz *.doc
tar -zcvf pics.tar.gz *.jpg *.png
tar -jcvf data.tbz2 *.doc
ls -l
gzip mydata.doc
gzip *.jpg
ls -l
bzip2 mydata.doc
bzip2 *.jpg
ls -l
zip mydata.zip mydata.doc
zip data.zip *.doc
ls -l

Decompress

tar -zxvf data.tgz 
tar -zxvf pics.tar.gz *.jpg
tar -jxvf data.tbz2
gzip -d mydata.doc.gz
gunzip mydata.doc.gz
bzip2 -d mydata.doc.bz2
gunzip mydata.doc.bz2
unzip file.zip
unzip data.zip resume.doc

Links

Bash Zip CheatSheet

@0nn0
Copy link
Owner

0nn0 commented May 14, 2016

Not included for now, in order to keep things simple. Will reconsider if there are more requests. Thanks!

@0nn0 0nn0 closed this as completed May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants