Here is a detailed explanation on how it is possible to extract specific files from an archive. Specifically GNU tar can be used to extract a single or more files from a tarball. To extract specific archive members, give their exact member names as arguments.
For example:
tar --extract --file={tarball.tar} {file}
You can also extract those files that match a specific globbing pattern (wildcards). For example, to extract from cbz.tar all files that begin with pic, no matter their directory prefix, you could type:
tar -xf cbz.tar --wildcards --no-anchored 'pic*'
To extract all php files, enter:
tar -xf cbz.tar --wildcards --no-anchored '*.php'
Where,
-x
: instructs tar to extract files.
-f
: specifies filename / tarball name.
-v
: Verbose (show progress while extracting files).
-j
: filter archive through bzip2, use to decompress .bz2 files.
-z
: filter archive through gzip, use to decompress .gz files.
--wildcards
: instructs tar to treat command line arguments as globbing patterns.
--no-anchored
: informs it that the patterns apply to member names after any / delimiter.
The cat > file
should work no matter when you call it, as long as you didn't read from it before and "use up" the input stream, or close the file descriptor, which you don't. This is a completely legal and normal command and it works, at least on my side.
Best Answer
It's a joke.
tar
(Tape ARchive) is the name of the program used to create an archive that contains several files, all glued together.Tar is also a black and sticky substance obtained from hydrocarbons. It translates to catrame in Italian (from your name, I suppose you're Italian).
Therefore, if you take a bunch of files and stick and roll all of them together via the
tar
program, you obtain a tar ball or tarball.