This month — in the penultimate article of a series on new features added to utilities by GNU hackers and others– let’s look at changes to the somewhat-under-named “tape archiver,” or tar. This program handles a lot more than tapes: It packs files and their metadata (permissions, owner, links and more) into an archive format that can be compressed and transferred across a network, fed through a pipe to another tar running in a different directory, stored on a public server for people to download — and yes, written to a tape.
Let’s look at GNU tar version 1.13.93 from the Debian stable distribution.
Keys Versus Options
Some of the original Unix utilities didn’t accept options starting with a dash (–). Instead, their first argument was one or more key characters, like options without the dashes. One of these utilities was dump and another was tar. Some keys had corresponding arguments — a filename or the blocking factor, for instance — and the arguments had to come in the same order as their keys.
For example, to add a tar file on the no-rewind tape device /dev/ nrst8 and use a blocking factor of 20, you’d use the add flag r, the file flag f, the blocking factor flag b, then the arguments for the f and b keys, and finally the filenames to add. You’d type:
$ tar rfb /dev/nrst8 20 dir1 dir2
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: