tar, A GNU project which we happened to stumble upon atleast once, and it is never easy understanding the flags to use in order to compress or extract files, so in this short blog post, I am going to give you a list of basic tar functions and their flags and a good way of remembering them. I want to thank an anonymous dev.to user who came up with this idea ‘cause honestly I think it is a nice way. So without further a do, lets dive in and Warning - PG 13 content ahead !
extracting using tar is something we would end up doing using tar, and to do that we use the following code
tar -xzvf name-of-archive.tar.gz
How to remember it?
tar Xtract Zhe Vucking File filename.tar.gz
May not be the best way but does get the job done
tar lets you compress files or a directory in a tar.gz file. The flags for compressing are quite similar to that of extracting.
tar -czvf name-of-archive.tar.gz
How do you remember? This shouldn’t be hard to figure out, once you know the first one
So the next time you ever see a tar.gz file, you won’t have to worry about how to extract, ‘cause you will have it, at the back of your head
Happy compressing and extracting !
Courtesy - dev.to
- Jayakrishna Sahit