Log in

Tech Tip: GNU tar’s “-a” Flag - Shlomif's Technical Posts Community [entries|archive|friends|userinfo]
Shlomif's Technical Posts Community

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Links:| Shlomi Fish's Homepage Main Journal Homesite Blog Planet Linux-IL Amir Aharoni in Unicode open dot dot dot ]

Tech Tip: GNU tar’s “-a” Flag [May. 27th, 2012|11:38 pm]
Shlomif's Technical Posts Community


[Tags|, , , , , , ]
[Current Location |Home]
[Current Music |Florence and the Machine - Shake it Out.]

On this post to the Mageia development mailing list by Thierry Vignaud, I discovered that GNU tar (at least in recent versions) has an “-a” flag which is useful in conjunction with its “-c” (create new archive) mode. This is because it detects the suitable compression based on the extension and uses the appropriate flag.

So: “tar -cavf myarchive.tar.gz ./mydir/” is equivalent to “tar -czvf myarchive.tar.gz ./mydir/”, “tar -cavf myarchive.tar.bz2 ./mydir/” does the same thing as “tar -cjvf myarchive.tar.bz2 ./mydir/” and so forth. When unpacking archives, you can omit the “-a/-z/-j/-J” flags, because GNU tar will detect the compression of the archive based on the file magic of the compressed formats.

Another useful (and open-source) tool for manipulating tarballs and other archives is patool, but I've been meaning to suggest they do a short-circuiting when converting tarballs from .tar.gz to .tar.xz to .tar.bz2 / etc.

Anyway, enjoy.


I know I’ve been really negligent with blogging in my blogs lately (which is not good), but don’t worry - I am fine, just busy with a lot of stuff including work work (which gives money but consumes time), doing quite a lot of coding and other development on open-source software, some Freecell-related research, keeping up with my E-mails, posting to mailing lists, playing some computer games, chatting a lot (maybe too much) on the IRC, and naturally - sleeping.

It seems that despite starting the new job in December, and despite the fact that it was now spring time (which is often a time of calamity for me), I did not have any particularly strong periods of stress lately, which is a good think. Thanks, $DEITY!

Today a friend who is an Israeli open-source enthusiast called me and asked me why I disappeared and if everything OK, and I replied, but he later called again and said his mobile phone mixed me with someone else. Anyway, you can always reach me in many ways, but I think I should start blogging more often, so I‘ve picked up this tech tip as the lowest hanging fruit.


From: (Anonymous)
2012-06-15 09:26 am (UTC)


Dear Shlomi,

Sometimes in life we have to choose to emphasize our strengths for all sorts of reasons - career, relationships, privacy, and so on. We may also choose to downplay (or outright hide) our weaknesses, or weave them in texts in such a way that a connection to the author is only implicit.

When the subject is technical issues, you're a very good presenter. You take a problem or an enlightenment and describe it in a way that the reader can both understand what you're talking about but also get a sense of your technical abilities. But when you discuss your personal life, content is not as rich and the feeling you create for the reader is exactly the opposite.

I would like to suggest you, in all honesty, to focus on this blog and it alone. I have a feeling that the mere availability of content in the other blogs does more damage than good, and you should either share your feelings in the form of stories, plays, and essays, or keep a private journal.

I can assure you that individuals impressed by your skills and in need of someone who is able to combine the two for the purposes of, say, technical writing, may have second thoughts about, or indeed rule out, hiring you (even for a job to which you can telecommute) which to me seems like a lose-lose scenario.


(Reply) (Thread)