I'm processing files for a friend without access to unix tools and I have to read the manual to use the tools necessary.
This is always a key to being able to do whatever it is one wants to do when using GNU/Linux or any unix variant for that matter.
This is a simple tool called zip.
It's fairly easy for me to use zip basic functions because I already understand the basics of how a lot of manual pages are written.
Although, there are methods for using zip described in the manual ( man page ) that are still over my head too.
examples are streaming input and when and how zip64, bzip or bzip2 is used when calling zip, mostly because I only use zip for files that my windows friends need to unzip without access to unix tools.
If I want to use unix tools for compression I just go with xz as it's what has been discussed as a standard for .debs
OK,
here's a snippet of the zip manual explaining the basics of zip usage.
Code: Select all
Command format. The basic command format is
zip options archive inpath inpath ...
where archive is a new or existing zip archive and inpath is a direc-
tory or file path optionally including wildcards. When given the name
of an existing zip archive, zip will replace identically named entries
in the zip archive (matching the relative names as stored in the ar-
chive) or add entries for new names. For example, if foo.zip exists
and contains foo/file1 and foo/file2, and the directory foo contains
the files foo/file1 and foo/file3, then:
zip -r foo.zip foo
or more concisely
zip -r foo foo
will replace foo/file1 in foo.zip and add foo/file3 to foo.zip. After
this, foo.zip contains foo/file1, foo/file2, and foo/file3, with
foo/file2 unchanged from before.
So if before the zip command is executed foo.zip has:
foo/file1 foo/file2
and directory foo has:
file1 file3
then foo.zip will have:
foo/file1 foo/file2 foo/file3
where foo/file1 is replaced and foo/file3 is new.
I usually skim the manual for entries I 'm using right now and skimming the basics is not the best idea
when using a tool. So I had to go back and carefully re-read this part of the man page until I got it.
For you advanced users already sneering at this Tip
yeah I know, so simple!
But it's early in the morning and I'm way behind in my sleep schedule, still..
For those following this Tip and would like to follow it down the rabbit hole
here is another manual snippet which will give you some instant gratification or more reading for extra credit.
Code: Select all
options
-@
-
[...]
-h
-?
--help
Display the zip help information (this also appears if zip is
run with no arguments).
-h2
--more-help
Display extended help including more on command line format,
pattern matching, and more obscure options.]