Streaming input and output of zip
zip will also accept a single dash -
as the zip file name, in which case it will write the zip file to standard output, allowing the output to be piped to another program.
For example the dd
program can write the standard output to a file in another location. In the following example dd
writes the standard output to a new file called test.zip (a zip archive) located on the user Denis's desktop.
cd /dir/with/uzipped/odt zip -r - . | dd of=/home/Denis/Desktop/test.zip
The of
that is typed after dd
stands for output file. The .
that comes after the single dash denotes the current directory.
Converting a zip file to odt
Because an .odt file is structured like a .zip file, you can view the contents of an .odt file by renaming the file's extension to .zip and then extracting the files from the zip archive. If you have preserved the directory structure of the original .odt file, you can convert the .zip file back to an .odt file after you have made changes to it by renaming the file's .zip extension back to .odt.