Making Stuff, Trying New Things, Going on Adventures

Reading the Manual: GNU tar (Part 1)

Motivation

When I'm stumped by a problem in programming or computing, I generally find myself searching the internet. I haven't jumped on the LLM bandwagon for this. Not because I'm worried it'll be wrong, moreso that I suspect I'll get my answer, but I won't learn anything. I wondered if a programmer from a previous generation would feel the same way about my search engine/Stack Overflow method for problem solving that I do about the LLM strategy. And when I find myself using software that's particularly specialized or unusual, finding specific answers online gets harder, and my trust in an LLM's answers is significantly lower. So I've decided to finally RTFM, and see if I learn anything interesting. Today, I'm reading the manual for GNU tar.

GNU tar

Short for "tape archive", tar is used for gathering a collection of files together into a single archive. Originally, it was used to archive data onto magnetic tape. These days, I mostly see it used alongside gzip to collect and compress collections for transfer over the internet. Many people use tar just infrequently enough that they never quite remember the right set of command line options for their use-case. Relevant XKCD: relevant_xkcd I used to have this problem, until I learned a mnemonic from a Stack Overflow post I can't find anymore. To create a .tar.gz, you use tar -czvf some_directory to "compress ze vucking file". To open a .tar.gz file, you use tar -xzvf to "xtract ze vucking file".

The Manual Itself

The GNU tar manual is available in 14 formats, not counting print versions. I'm using the second option on that list, HTML with one web page per node. The format here is pretty typical for GNU documentation on the web. It's split into chapters, and each chapter is split into sections. There are arrow buttons to move between chapters and sections, and an "Up" button to move from section text to the list of sections, and from the list of sections in a chapter to the list of chapters.

Observations

Section 1: Introduction

Section 2: Tutorial Introduction to tar

Conclusion

I'd recommend beginners tutorial in the GNU tar manual to anyone who, like me uses tar like it's a magic incantation. I wish the manual introduced compression in this tutorial section. While I understand the need for simplicity and brevity in a beginners tutorial, most modern use cases for tar use compression. I plan to go through the rest of the manual in future posts.

#linux #programming #reading-the-manual