Comment on Show HN: Extract it – Because nobody can remember tar commandsComments−keithgabryelski11yYou basically need to know three options for tar:-x EXTRACT -c CREATE -f - USE STDIN/OUTto create a tar file of the current directory:tar -cf - . | gzip > /tmp/foo.tar.gzto extract:gzip < /tmp/foo.tar.gz | tar -xf -why tar has all the options was someone's idea they were helping you out -- they weren'tCreate is -c --- remember that eXtract is -x - remember that -f - is stdout/stdin depending on your need -- remember thatpipes are your friend.
Comments
You basically need to know three options for tar:
-x EXTRACT -c CREATE -f - USE STDIN/OUT
to create a tar file of the current directory:
tar -cf - . | gzip > /tmp/foo.tar.gz
to extract:
gzip < /tmp/foo.tar.gz | tar -xf -
why tar has all the options was someone's idea they were helping you out -- they weren't
Create is -c --- remember that eXtract is -x - remember that -f - is stdout/stdin depending on your need -- remember that
pipes are your friend.