<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ru Servers Reference Blog &#187; Linux</title>
	<atom:link href="http://blog.server.ruservers.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.server.ruservers.com</link>
	<description>Server Maintenance Guide</description>
	<lastBuildDate>Tue, 27 Jul 2010 12:14:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Linux Commands: Move or rename files or directories</title>
		<link>http://blog.server.ruservers.com/2009/03/linux-commands-move-or-rename-files-or-directories/</link>
		<comments>http://blog.server.ruservers.com/2009/03/linux-commands-move-or-rename-files-or-directories/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 22:30:22 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/03/linux-commands-move-or-rename-files-or-directories/</guid>
		<description><![CDATA[&#160; Source: http://webtools.live2support.com/linux/mv.php &#160; mv-Linux Command &#160; mv Move or rename files or directories. SYNTAX mv [options]... Source Dest mv [options]... Source... Directory If the last argument names an existing directory, `mv&#8217; moves each other given file into a file with the same name in that directory. Otherwise, if only two files are given, it [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://webtools.live2support.com/linux/mv.php" href="http://webtools.live2support.com/linux/mv.php" target="_blank">http://webtools.live2support.com/linux/mv.php</a></p>
<p>&#160;</p>
<h3><b>mv-Linux Command</b></h3>
<p>&#160;</p>
<p>mv</p>
<p>Move or rename files or directories.</p>
<pre>SYNTAX
      mv [<em>options</em>]... <em>Source</em> <em>Dest</em>

      mv [<em>options</em>]... <em>Source</em>... <em>Directory</em></pre>
<p>If the last argument names an existing directory, `mv&#8217; moves each other given file into a file with the same name in that directory. Otherwise, if only two files are given, it renames the first as the second. It is an error if the last argument is not a directory and more than two files are given.</p>
<pre>OPTIONS  

-b
--backup
     Make a backup of each file that would otherwise be overwritten or
     removed.

-f
--force
     Remove existing destination files and never prompt the user.

-i
--interactive
     Prompt whether to overwrite each existing destination file,
     regardless of its permissions.  If the response does not begin
     with `y' or `Y', the file is skipped.

-S <em>SUFFIX</em>
--suffix=<em>SUFFIX</em>
     Append <em>SUFFIX</em> to each backup file made with `-b'.
     The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX.

-u
--update
     Do not move a nondirectory that has an existing destination with
     the same or newer modification time.

-v
--verbose
     Print the name of each file before moving it.

-V <em>METHOD</em>
--version-control=<em>METHOD</em>'
     Change the type of backups made with `-b'. METHOD can be:

       t, numbered     make numbered backups
       nil, existing   numbered if numbered backups exist, simple otherwise
       never, simple   always make simple backups

 --help                   display help and exit
 --version                output version information and exit

<strong></strong></pre>
<h4>Examples</h4>
<pre><strong></strong>

Rename the file apple as orange.doc:
mv apple orange.doc

Move orange.doc to the Documents folder:
mv orange.doc ~/Documents/orange.doc

Rename a bunch of file extensions
e.g. change *.txt into *.htm
  for f in *.txt; do mv ./&quot;$f&quot; &quot;${f%txt}htm&quot;; done</pre>
<p>`mv&#8217; can move only regular files across filesystems.<br />
  <br />If a destination file exists but is normally unwritable, standard input is a terminal, and the `-f&#8217; or `&#8211;force&#8217; option is not given, `mv&#8217; prompts the user for whether to replace the file. (You might own the file, or have write permission on its directory.) If the response does not begin with `y&#8217; or `Y&#8217;, the file is skipped.</p>
<p><b>Related Linux Bash commands</b>:</p>
<p><a href="http://blog.server.ruservers.com/2009/01/linux-unix-copy-command/">cp</a> &#8211; Copy one or more files to another location</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/03/linux-commands-move-or-rename-files-or-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix Command: unzip</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-command-unzip/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-command-unzip/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 04:58:57 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-command-unzip/</guid>
		<description><![CDATA[&#160; Source: http://linux.about.com/od/commands/l/blcmdl1_unzip.htm &#160; NAME unzip &#8211; list, test and extract compressed files in a ZIP archive unzip [-Z] [-cflptuvz[abjnoqsCLMVX$/:]] file[.zip] [file(s) ...] [-x xfile(s) ...] [-d exdir] DESCRIPTION unzip will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://linux.about.com/od/commands/l/blcmdl1_unzip.htm" href="http://linux.about.com/od/commands/l/blcmdl1_unzip.htm" target="_blank">http://linux.about.com/od/commands/l/blcmdl1_unzip.htm</a></p>
<p>&#160;</p>
<h4>NAME</h4>
<p>unzip &#8211; list, test and extract compressed files in a ZIP archive</p>
<p><b>unzip</b> [<b>-Z</b>] [<b>-cflptuvz</b>[<b>abjnoqsCLMVX$/:</b>]] <i>file</i>[<i>.zip</i>] [<i>file(s)</i> ...] [<b>-x</b> <i>xfile(s)</i> ...] [<b>-d</b> <i>exdir</i>] <a name="lbAD"></a></p>
<h4>DESCRIPTION</h4>
<p><i>unzip</i> will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive. A companion program, <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L), creates ZIP archives; both programs are compatible with archives created by PKWARE&#8217;s <i>PKZIP</i> and <i>PKUNZIP</i> for MS-DOS, but in many cases the program options or default behaviors differ.</p>
<h4>ARGUMENTS</h4>
<dl compact="compact">
<dt><i>file</i>[<i>.zip</i>] </dt>
<dd>Path of the ZIP archive(s). If the file specification is a wildcard, each matching file is processed in an order determined by the operating system (or file system). Only the filename can be a wildcard; the path itself cannot. Wildcard expressions are similar to those supported in commonly used Unix shells (<i>sh</i>, <i>ksh</i>, <i>csh</i>) and may contain:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt>* </dt>
<dd>matches a sequence of 0 or more characters </dd>
<dt>? </dt>
<dd>matches exactly 1 character </dd>
<dt>[...] </dt>
<dd>matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an ending character. If an exclamation point or a caret (`!&#8217; or `^&#8217;) follows the left bracket, then the range of characters within the brackets is complemented (that is, anything <i>except</i> the characters inside the brackets is considered a match). </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>(Be sure to quote any character that might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.) If no matches are found, the specification is assumed to be a literal filename; and if that also fails, the suffix .zip is appended. Note that self-extracting ZIP files are supported, as with any other ZIP archive; just specify the .exe suffix (if any) explicitly. </dd>
<dt>[<i>file(s)</i>] </dt>
<dd>An optional list of archive members to be processed, separated by spaces. (VMS versions compiled with VMSCLI defined must delimit files with commas instead. See <b>-v</b> in <b>OPTIONS</b> below.) Regular expressions (wildcards) may be used to match multiple members; see above. Again, be sure to quote expressions that would otherwise be expanded or modified by the operating system. </dd>
<dt>[<b>-x</b> <i>xfile(s)</i>] </dt>
<dd>An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/&#8217;), this option may be used to exclude any files that are in subdirectories. For example, &#8220;unzip foo *.[ch] -x */*&#8221; would extract all C source files in the main directory, but none in any subdirectories. Without the <b>-x</b> option, all C source files in all directories within the zipfile would be extracted. </dd>
<dt>[<b>-d</b> <i>exdir</i>] </dt>
<dd>An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the <b>-d</b> option allows extraction in an arbitrary directory (always assuming one has permission to write to the directory). This option need not appear at the end of the command line; it is also accepted before the zipfile specification (with the normal options), immediately after the zipfile specification, or between the <i>file(s)</i> and the <b>-x</b> option. The option and directory may be concatenated without any white space between them, but note that this may cause normal shell behavior to be suppressed. In particular, &#8220;-d ~&#8221; (tilde) is expanded by Unix C shells into the name of the user&#8217;s home directory, but &#8220;-d~&#8221; is treated as a literal subdirectory &#8220;<b>~</b>&#8221; of the current directory. </dd>
</dl>
<p><a name="lbAF"></a><br />
<h4>OPTIONS</h4>
<p> Note that, in order to support obsolescent hardware, <i>unzip</i>&#8216;s usage screen is limited to 22 or 23 lines and should therefore be considered only a reminder of the basic <i>unzip</i> syntax rather than an exhaustive list of all possible flags. The exhaustive list follows:
<dl compact="compact">
<dt><b>-Z</b></dt>
<dd><i><a href="http://linux.about.com/library/cmd/blcmdl1L_zipinfo.htm">zipinfo</a></i>(1L) mode. If the first option on the command line is <b>-Z</b>, the remaining options are taken to be <i><a href="http://linux.about.com/library/cmd/blcmdl1L_zipinfo.htm">zipinfo</a></i>(1L) options. See the appropriate manual page for a description of these options. </dd>
<dt><b>-A</b></dt>
<dd>[OS/2, Unix DLL] print extended help for the DLL&#8217;s programming interface (API). </dd>
<dt><b>-c</b></dt>
<dd>extract files to stdout/screen (&#8220;CRT&#8221;). This option is similar to the <b>-p</b> option except that the name of each file is printed as it is extracted, the <b>-a</b> option is allowed, and ASCII-EBCDIC conversion is automatically performed if appropriate. This option is not listed in the <i>unzip</i> usage screen. </dd>
<dt><b>-f</b></dt>
<dd>freshen existing files, i.e., extract only those files that already exist on disk and that are newer than the disk copies. By default <i>unzip</i> queries before overwriting, but the <b>-o</b> option may be used to suppress the queries. Note that under many operating systems, the TZ (timezone) environment variable must be set correctly in order for <b>-f</b> and <b>-u</b> to work properly (under Unix the variable is usually set automatically). The reasons for this are somewhat subtle but have to do with the differences between DOS-format file times (always local time) and Unix-format times (always in GMT/UTC) and the necessity to compare the two. A typical TZ value is &#8220;PST8PDT&#8221; (US Pacific time with automatic adjustment for Daylight Savings Time or &#8220;summer time&#8221;). </dd>
<dt><b>-l</b></dt>
<dd>list archive files (short format). The names, uncompressed file sizes and modification dates and times of the specified files are printed, along with totals for all files specified. If UnZip was compiled with OS2_EAS defined, the <b>-l</b> option also lists columns for the sizes of stored OS/2 extended attributes (EAs) and OS/2 access control lists (ACLs). In addition, the zipfile comment and individual file comments (if any) are displayed. If a file was archived from a single-case file system (for example, the old MS-DOS FAT file system) and the <b>-L</b> option was given, the filename is converted to lowercase and is prefixed with a caret (^). </dd>
<dt><b>-p</b></dt>
<dd>extract files to pipe (stdout). Nothing but the file data is sent to stdout, and the files are always extracted in binary format, just as they are stored (no conversions). </dd>
<dt><b>-t</b></dt>
<dd>test archive files. This option extracts each specified file in memory and compares the CRC (cyclic redundancy check, an enhanced checksum) of the expanded file with the original file&#8217;s stored CRC value. </dd>
<dt><b>-T</b></dt>
<dd>[most OSes] set the timestamp on the archive(s) to that of the newest file in each one. This corresponds to <i>zip</i>&#8216;s <b>-go</b> option except that it can be used on wildcard zipfiles (e.g., &#8220;unzip -T \*.zip&#8221;) and is much faster. </dd>
<dt><b>-u</b></dt>
<dd>update existing files and create new ones if needed. This option performs the same function as the <b>-f</b> option, extracting (with query) files that are newer than those with the same name on disk, and in addition it extracts those files that do not already exist on disk. See <b>-f</b> above for information on setting the timezone properly. </dd>
<dt><b>-v</b></dt>
<dd>be verbose or print diagnostic version info. This option has evolved and now behaves as both an option and a modifier. As an option it has two purposes: when a zipfile is specified with no other options, <b>-v</b> lists archive files verbosely, adding to the basic <b>-l</b> info the compression method, compressed size, compression ratio and 32-bit CRC. When no zipfile is specified (that is, the complete command is simply &#8220;unzip -v&#8221;), a diagnostic screen is printed. In addition to the normal header with release date and version, <i>unzip</i> lists the home Info-ZIP ftp site and where to find a list of other ftp and non-ftp sites; the target operating system for which it was compiled, as well as (possibly) the hardware on which it was compiled, the compiler and version used, and the compilation date; any special compilation options that might affect the program&#8217;s operation (see also <b>DECRYPTION</b> below); and any options stored in environment variables that might do the same (see <b>ENVIRONMENT OPTIONS</b> below). As a modifier it works in conjunction with other options (e.g., <b>-t</b>) to produce more verbose or debugging output; this is not yet fully implemented but will be in future releases. </dd>
<dt><b>-z</b></dt>
<dd>display only the archive comment. </dd>
</dl>
<p><a name="lbAG"></a><br />
<h4>MODIFIERS</h4>
<dl compact="compact">
<dt><b>-a</b></dt>
<dd>convert text files. Ordinarily all files are extracted exactly as they are stored (as &#8220;binary&#8221; files). The <b>-a</b> option causes files identified by <i>zip</i> as text files (those with the `t&#8217; label in <i>zipinfo</i> listings, rather than `b&#8217;) to be automatically extracted as such, converting line endings, end-of-file characters and the character set itself as necessary. (For example, Unix files use line feeds (LFs) for end-of-line (EOL) and have no end-of-file (EOF) marker; Macintoshes use carriage returns (CRs) for EOLs; and most PC operating systems use CR+LF for EOLs and control-Z for EOF. In addition, IBM mainframes and the Michigan Terminal System use EBCDIC rather than the more common ASCII character set, and NT supports Unicode.) Note that <i>zip</i>&#8216;s identification of text files is by no means perfect; some &#8220;text&#8221; files may actually be binary and vice versa. <i>unzip</i> therefore prints &#8220;[text]&#8221; or &#8220;[binary]&#8221; as a visual check for each file it extracts when using the <b>-a</b> option. The <b>-aa</b> option forces all files to be extracted as text, regardless of the supposed file type. </dd>
<dt><b>-b</b></dt>
<dd>[general] treat all files as binary (no text conversions). This is a shortcut for <b>&#8212;a</b>. </dd>
<dt><b>-b</b></dt>
<dd>[Tandem] force the creation files with filecode type 180 (&#8216;C&#8217;) when extracting Zip entries marked as &quot;text&quot;. (On Tandem, <b>-a</b> is enabled by default, see above). </dd>
<dt><b>-b</b></dt>
<dd>[VMS] auto-convert binary files (see <b>-a</b> above) to fixed-length, 512-byte record format. Doubling the option (<b>-bb</b>) forces all files to be extracted in this format. When extracting to standard output (<b>-c</b> or <b>-p</b> option in effect), the default conversion of text record delimiters is disabled for binary (<b>-b</b>) resp. all (<b>-bb</b>) files. </dd>
<dt><b>-B</b></dt>
<dd>[Unix only, and only if compiled with UNIXBACKUP defined] save a backup copy of each overwritten file with a tilde appended (e.g., the old copy of &#8220;foo&#8221; is renamed to &#8220;foo~&#8221;). This is similar to the default behavior of <i><a href="http://linux.about.com/library/cmd/blcmdl1_emacs.htm">emacs</a></i>(1) in many locations. </dd>
<dt><b>-C</b></dt>
<dd>match filenames case-insensitively. <i>unzip</i>&#8216;s philosophy is &#8220;you get what you ask for&#8221; (this is also responsible for the <b>-L</b>/<b>-U</b> change; see the relevant options below). Because some file systems are fully case-sensitive (notably those under the Unix operating system) and because both ZIP archives and <i>unzip</i> itself are portable across platforms, <i>unzip</i>&#8216;s default behavior is to match both wildcard and literal filenames case-sensitively. That is, specifying &#8220;makefile&#8221; on the command line will <i>only</i> match &#8220;makefile&#8221; in the archive, not &#8220;Makefile&#8221; or &#8220;MAKEFILE&#8221; (and similarly for wildcard specifications). Since this does not correspond to the behavior of many other operating/file systems (for example, OS/2 HPFS, which preserves mixed case but is not sensitive to it), the <b>-C</b> option may be used to force all filename matches to be case-insensitive. In the example above, all three files would then match &#8220;makefile&#8221; (or &#8220;make*&#8221;, or similar). The <b>-C</b> option affects files in both the normal file list and the excluded-file list (xlist). </dd>
<dt><b>-E</b></dt>
<dd>[MacOS only] display contents of MacOS extra field during restore operation. </dd>
<dt><b>-F</b></dt>
<dd>[Acorn only] suppress removal of NFS filetype extension from stored filenames. </dd>
<dt><b>-F</b></dt>
<dd>[non-Acorn systems supporting long filenames with embedded commas, and only if compiled with ACORN_FTYPE_NFS defined] translate filetype information from ACORN RISC OS extra field blocks into a NFS filetype extension and append it to the names of the extracted files. (When the stored filename appears to already have an appended NFS filetype extension, it is replaced by the info from the extra field.) </dd>
<dt><b>-i</b></dt>
<dd>[MacOS only] ignore filenames stored in MacOS extra fields. Instead, the most compatible filename stored in the generic part of the entry&#8217;s header is used. </dd>
<dt><b>-j</b></dt>
<dd>junk paths. The archive&#8217;s directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one). </dd>
<dt><b>-J</b></dt>
<dd>[BeOS only] junk file attributes. The file&#8217;s BeOS file attributes are not restored, just the file&#8217;s data. </dd>
<dt><b>-J</b></dt>
<dd>[MacOS only] ignore MacOS extra fields. All Macintosh specific info is skipped. Data-fork and resource-fork are restored as separate files. </dd>
<dt><b>-L</b></dt>
<dd>convert to lowercase any filename originating on an uppercase-only operating system or file system. (This was <i>unzip</i>&#8216;s default behavior in releases prior to 5.11; the new default behavior is identical to the old behavior with the <b>-U</b> option, which is now obsolete and will be removed in a future release.) Depending on the archiver, files archived under single-case file systems (VMS, old MS-DOS FAT, etc.) may be stored as all-uppercase names; this can be ugly or inconvenient when extracting to a case-preserving file system such as OS/2 HPFS or a case-sensitive one such as under Unix. By default <i>unzip</i> lists and extracts such filenames exactly as they&#8217;re stored (excepting truncation, conversion of unsupported characters, etc.); this option causes the names of all files from certain systems to be converted to lowercase. The <b>-LL</b> option forces conversion of every filename to lowercase, regardless of the originating file system. </dd>
<dt><b>-M</b></dt>
<dd>pipe all output through an internal pager similar to the Unix <i><a href="http://linux.about.com/library/cmd/blcmdl1_more.htm">more</a></i>(1) command. At the end of a screenful of output, <i>unzip</i> pauses with a &#8220;&#8211;More&#8211;&#8221; prompt; the next screenful may be viewed by pressing the Enter (Return) key or the space bar. <i>unzip</i> can be terminated by pressing the &#8220;q&#8221; key and, on some systems, the Enter/Return key. Unlike Unix <i><a href="http://linux.about.com/library/cmd/blcmdl1_more.htm">more</a></i>(1), there is no forward-searching or editing capability. Also, <i>unzip</i> doesn&#8217;t notice if long lines wrap at the edge of the screen, effectively resulting in the printing of two or more lines and the likelihood that some text will scroll off the top of the screen before being viewed. On some systems the number of available lines on the screen is not detected, in which case <i>unzip</i> assumes the height is 24 lines. </dd>
<dt><b>-n</b></dt>
<dd>never overwrite existing files. If a file already exists, skip the extraction of that file without prompting. By default <i>unzip</i> queries before extracting any file that already exists; the user may choose to overwrite only the current file, overwrite all files, skip extraction of the current file, skip extraction of all existing files, or rename the current file. </dd>
<dt><b>-N</b></dt>
<dd>[Amiga] extract file comments as Amiga filenotes. File comments are created with the -c option of <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L), or with the -N option of the Amiga port of <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L), which stores filenotes as comments. </dd>
<dt><b>-o</b></dt>
<dd>overwrite existing files without prompting. This is a dangerous option, so use it with care. (It is often used with <b>-f</b>, however, and is the only way to overwrite directory EAs under OS/2.) </dd>
<dt><b>-P</b> <i>password</i></dt>
<dd>use <i>password</i> to decrypt encrypted zipfile entries (if any). <b>THIS IS INSECURE!</b> Many multi-user operating systems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the-shoulder peeking. Storing the plaintext password as part of a command line in an automated script is even worse. Whenever possible, use the non-echoing, interactive prompt to enter passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utilities.) </dd>
<dt><b>-q</b></dt>
<dd>perform operations quietly (<b>-qq</b> = even quieter). Ordinarily <i>unzip</i> prints the names of the files it&#8217;s extracting or testing, the extraction methods, any file or zipfile comments that may be stored in the archive, and possibly a summary when finished with each archive. The <b>-q</b>[<b>q</b>] options suppress the printing of some or all of these messages. </dd>
<dt><b>-s</b></dt>
<dd>[OS/2, NT, MS-DOS] convert spaces in filenames to underscores. Since all PC operating systems allow spaces in filenames, <i>unzip</i> by default extracts filenames with spaces intact (e.g., &#8220;EA DATA. SF&#8221;). This can be awkward, however, since MS-DOS in particular does not gracefully support spaces in filenames. Conversion of spaces to underscores can eliminate the awkwardness in some cases. </dd>
<dt><b>-U</b></dt>
<dd>(obsolete; to be removed in a future release) leave filenames uppercase if created under MS-DOS, VMS, etc. See <b>-L</b> above. </dd>
<dt><b>-V</b></dt>
<dd>retain (VMS) file version numbers. VMS files can be stored with a version number, in the format file.ext;##. By default the &#8220;;##&#8221; version numbers are stripped, but this option allows them to be retained. (On file systems that limit filenames to particularly short lengths, the version numbers may be truncated or stripped regardless of this option.) </dd>
<dt><b>-X</b></dt>
<dd>[VMS, Unix, OS/2, NT] restore owner/protection info (UICs) under VMS, or user and group info (UID/GID) under Unix, or access control lists (ACLs) under certain network-enabled versions of OS/2 (Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp Connect with IBM Peer 1.0), or security ACLs under Windows NT. In most cases this will require special system privileges, and doubling the option (<b>-XX</b>) under NT instructs <i>unzip</i> to use privileges for extraction; but under Unix, for example, a user who belongs to several groups can restore files owned by any of those groups, as long as the user IDs match his or her own. Note that ordinary file attributes are always restored&#8211;this option applies only to optional, extra ownership info available on some operating systems. [NT's access control lists do not appear to be especially compatible with OS/2's, so no attempt is made at cross-platform portability of access privileges. It is not clear under what conditions this would ever be useful anyway.] </dd>
<dt><b>-$</b></dt>
<dd>[MS-DOS, OS/2, NT] restore the volume label if the extraction medium is removable (e.g., a diskette). Doubling the option (<b>-$$</b>) allows fixed media (hard disks) to be labelled as well. By default, volume labels are ignored. </dd>
<dt><b>-/</b> <i>extensions</i></dt>
<dd>[Acorn only] overrides the extension list supplied by Unzip$Ext environment variable. During extraction, filename extensions that match one of the items in this extension list are swapped in front of the base name of the extracted file. </dd>
<dt><b>-:</b></dt>
<dd>[all but Acorn, VM/CMS, MVS, Tandem] allows to extract archive members into locations outside of the current &#8220; extraction root folder&#8221;. For security reasons, <i>unzip</i> normally removes &#8220;parent dir&#8221; path components (&#8220;../&#8221;) from the names of extracted file. This safety feature (new for version 5.50) prevents <i>unzip</i> from accidentally writing files to &#8220;sensitive&#8221; areas outside the active extraction folder tree head. The <b>-:</b> option lets <i>unzip</i> switch back to its previous, more liberal behaviour, to allow exact extraction of (older) archives that used &#8220;../&#8221; components to create multiple directory trees at the level of the current extraction folder. </dd>
</dl>
<p><a name="lbAH"></a><br />
<h4>ENVIRONMENT OPTIONS</h4>
<p> <i>unzip</i>&#8216;s default behavior may be modified via options placed in an environment variable. This can be done with any option, but it is probably most useful with the <b>-a</b>, <b>-L</b>, <b>-C</b>, <b>-q</b>, <b>-o</b>, or <b>-n</b> modifiers: make <i>unzip</i> auto-convert text files by default, make it convert filenames from uppercase systems to lowercase, make it match names case-insensitively, make it quieter, or make it always overwrite or never overwrite files as it extracts them. For example, to make <i>unzip</i> act as quietly as possible, only reporting errors, one would use one of the following commands:
<dl compact="compact">
<dt>Unix Bourne shell: </dt>
<dd>UNZIP=-qq; export UNZIP </dd>
<dt>Unix C shell: </dt>
<dd>setenv UNZIP -qq </dd>
<dt>OS/2 or MS-DOS: </dt>
<dd>set UNZIP=-qq </dd>
<dt>VMS (quotes for <i>lowercase</i>): </dt>
<dd>define UNZIP_OPTS &quot;&quot;-qq&quot;&quot; </dd>
</dl>
<p>Environment options are, in effect, considered to be just like any other command-line options, except that they are effectively the first options on the command line. To override an environment option, one may use the &#8220;minus operator&#8221; to remove it. For instance, to override one of the quiet-flags in the example above, use the command </p>
<pre>unzip --q[<i>other options</i>] zipfile</pre>
<p>The first hyphen is the normal switch character, and the second is a minus sign, acting on the q option. Thus the effect here is to cancel one quantum of quietness. To cancel both quiet flags, two (or more) minuses may be used: </p>
<pre>unzip -t--q zipfile
unzip ---qt zipfile</pre>
<p>(the two are equivalent). This may seem awkward or confusing, but it is reasonably intuitive: just ignore the first hyphen and go from there. It is also consistent with the behavior of Unix <i><a href="http://linux.about.com/library/cmd/blcmdl1_nice.htm">nice</a></i>(1). </p>
<p>As suggested by the examples above, the default variable names are UNZIP_OPTS for VMS (where the symbol used to install <i>unzip</i> as a foreign command would otherwise be confused with the environment variable), and UNZIP for all other operating systems. For compatibility with <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L), UNZIPOPT is also accepted (don&#8217;t ask). If both UNZIP and UNZIPOPT are defined, however, UNZIP takes precedence. <i>unzip</i>&#8216;s diagnostic option (<b>-v</b> with no zipfile name) can be used to check the values of all four possible <i>unzip</i> and <i>zipinfo</i> environment variables. </p>
<p>The timezone variable (TZ) should be set according to the local timezone in order for the <b>-f</b> and <b>-u</b> to operate correctly. See the description of <b>-f</b> above for details. This variable may also be necessary in order for timestamps on extracted files to be set correctly. Under Windows 95/NT <i>unzip</i> should know the correct timezone even if TZ is unset, assuming the timezone is correctly set in the Control Panel. <a name="lbAI"></a></p>
<h4>DECRYPTION</h4>
<p>Encrypted archives are fully supported by Info-ZIP software, but due to United States export restrictions, de-/encryption support might be disabled in your compiled binary. However, since spring 2000, US export restrictions have been liberated, and our source archives do now include full crypt code. In case you need binary distributions with crypt support enabled, see the file &#8220;WHERE&#8221; in any Info-ZIP source or binary distribution for locations both inside and outside the US. </p>
<p>Some compiled versions of <i>unzip</i> may not support decryption. To check a version for crypt support, either attempt to test or extract an encrypted archive, or else check <i>unzip</i>&#8216;s diagnostic screen (see the <b>-v</b> option above) for &#8220;[decryption]&#8221; as one of the special compilation options. </p>
<p>As noted above, the <b>-P</b> option may be used to supply a password on the command line, but at a cost in security. The preferred decryption method is simply to extract normally; if a zipfile member is encrypted, <i>unzip</i> will prompt for the password without echoing what is typed. <i>unzip</i> continues to use the same password as long as it appears to be valid, by testing a 12-byte header on each file. The correct password will always check out against the header, but there is a 1-in-256 chance that an incorrect password will as well. (This is a security feature of the PKWARE zipfile format; it helps prevent brute-force attacks that might otherwise gain a large speed advantage by testing only the header.) In the case that an incorrect password is given but it passes the header test anyway, either an incorrect CRC will be generated for the extracted data or else <i>unzip</i> will fail during the extraction because the &#8220;decrypted&#8221; bytes do not constitute a valid compressed data stream. </p>
<p>If the first password fails the header check on some file, <i>unzip</i> will prompt for another password, and so on until all files are extracted. If a password is not known, entering a null password (that is, just a carriage return or &#8220;Enter&#8221;) is taken as a signal to skip all further prompting. Only unencrypted files in the archive(s) will thereafter be extracted. (In fact, that&#8217;s not quite true; older versions of <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L) and <i><a href="http://linux.about.com/library/cmd/blcmdl1L_zipcloak.htm">zipcloak</a></i>(1L) allowed null passwords, so <i>unzip</i> checks each encrypted file to see if the null password works. This may result in &#8220;false positives&#8221; and extraction errors, as noted above.) </p>
<p>Archives encrypted with 8-bit passwords (for example, passwords with accented European characters) may not be portable across systems and/or other archivers. This problem stems from the use of multiple encoding methods for such characters, including Latin-1 (ISO 8859-1) and OEM code page 850. DOS <i>PKZIP</i> 2.04g uses the OEM code page; Windows <i>PKZIP</i> 2.50 uses Latin-1 (and is therefore incompatible with DOS <i>PKZIP</i>); Info-ZIP uses the OEM code page on DOS, OS/2 and Win3.x ports but Latin-1 everywhere else; and Nico Mak&#8217;s <i>WinZip</i> 6.x does not allow 8-bit passwords at all. <i>UnZip</i> 5.3 (or newer) attempts to use the default character set first (e.g., Latin-1), followed by the alternate one (e.g., OEM code page) to test passwords. On EBCDIC systems, if both of these fail, EBCDIC encoding will be tested as a last resort. (EBCDIC is not tested on non-EBCDIC systems, because there are no known archivers that encrypt using EBCDIC encoding.) ISO character encodings other than Latin-1 are not supported. <a name="lbAJ"></a></p>
<h4>EXAMPLES</h4>
<p>To use <i>unzip</i> to extract all members of the archive <i>letters.zip</i> into the current directory and subdirectories below it, creating any subdirectories as necessary: </p>
<pre>unzip letters</pre>
<p>To extract all members of <i>letters.zip</i> into the current directory only: </p>
<pre>unzip -j letters</pre>
<p>To test <i>letters.zip</i>, printing only a summary message indicating whether the archive is OK or not: </p>
<pre>unzip -tq letters</pre>
<p>To test <i>all</i> zipfiles in the current directory, printing only the summaries: </p>
<pre>unzip -tq \*.zip</pre>
<p>(The backslash before the asterisk is only required if the shell expands wildcards, as in Unix; double quotes could have been used instead, as in the source examples below.) To extract to standard output all members of <i>letters.zip</i> whose names end in <i>.tex</i>, auto-converting to the local end-of-line convention and piping the output into <i><a href="http://linux.about.com/library/cmd/blcmdl1_more.htm">more</a></i>(1): </p>
<pre>unzip -ca letters \*.tex | more</pre>
<p>To extract the binary file <i>paper1.dvi</i> to standard output and pipe it to a printing program: </p>
<pre>unzip -p articles paper1.dvi | dvips</pre>
<p>To extract all FORTRAN and C source files&#8211;*.f, *.c, *.h, and Makefile&#8211;into the /tmp directory: </p>
<pre>unzip source.zip &quot;*.[fch]&quot; Makefile -d /tmp</pre>
<p>(the double quotes are necessary only in Unix and only if globbing is turned on). To extract all FORTRAN and C source files, regardless of case (e.g., both *.c and *.C, and any makefile, Makefile, MAKEFILE or similar): </p>
<pre>unzip -C source.zip &quot;*.[fch]&quot; makefile -d /tmp</pre>
<p>To extract any such files but convert any uppercase MS-DOS or VMS names to lowercase and convert the line-endings of all of the files to the local standard (without respect to any files that might be marked &#8220;binary&#8221;): </p>
<pre>unzip -aaCL source.zip &quot;*.[fch]&quot; makefile -d /tmp</pre>
<p>To extract only newer versions of the files already in the current directory, without querying (NOTE: be careful of unzipping in one timezone a zipfile created in another&#8211;ZIP archives other than those created by Zip 2.1 or later contain no timezone information, and a &#8220;newer&#8221; file from an eastern timezone may, in fact, be older): </p>
<pre>unzip -fo sources</pre>
<p>To extract newer versions of the files already in the current directory and to create any files not already there (same caveat as previous example): </p>
<pre>unzip -uo sources</pre>
<p>To display a diagnostic screen showing which <i>unzip</i> and <i>zipinfo</i> options are stored in environment variables, whether decryption support was compiled in, the compiler with which <i>unzip</i> was compiled, etc.: </p>
<pre>unzip -v</pre>
<p>In the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q. To do a singly quiet listing: </p>
<pre>unzip -l file.zip</pre>
<p>To do a doubly quiet listing: </p>
<pre>unzip -ql file.zip</pre>
<p>(Note that the &#8220;.zip&#8221; is generally not necessary.) To do a standard listing: </p>
<pre>unzip --ql file.zip</pre>
<p>or </p>
<pre>unzip -l-q file.zip</pre>
<p>or </p>
<pre>unzip -l--q file.zip</pre>
<p>(Extra minuses in options don&#8217;t hurt.) <a name="lbAK"></a></p>
<h4>TIPS</h4>
<p>The current maintainer, being a lazy sort, finds it very useful to define a pair of aliases: tt for &#8220;unzip -tq&#8221; and ii for &#8220;unzip -Z&#8221; (or &#8220;zipinfo&#8221;). One may then simply type &#8220;tt zipfile&#8221; to test an archive, something that is worth making a habit of doing. With luck <i>unzip</i> will report &#8220;No errors detected in compressed data of zipfile.zip,&#8221; after which one may breathe a sigh of relief. </p>
<p>The maintainer also finds it useful to set the UNZIP environment variable to &#8220;-aL&#8221; and is tempted to add &#8220;-C&#8221; as well. His ZIPINFO variable is set to &#8220;-z&#8221;. <a name="lbAL"></a></p>
<h4>SEE ALSO</h4>
<p><i><a href="http://linux.about.com/library/cmd/blcmdl1_funzip.htm">funzip</a></i>(1L), <i><a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm">zip</a></i>(1L), <i><a href="http://linux.about.com/library/cmd/blcmdl1_zipcloak.htm">zipcloak</a></i>(1L), <i><a href="http://linux.about.com/library/cmd/blcmdl1_zipgrep.htm">zipgrep</a></i>(1L), <i><a href="http://linux.about.com/library/cmd/blcmdl1_zipinfo.htm">zipinfo</a></i>(1L), <i><a href="http://linux.about.com/library/cmd/blcmdl1_zipnote.htm">zipnote</a></i>(1L), <i><a href="http://linux.about.com/library/cmd/blcmdl1_zipsplit.htm">zipsplit</a></i>(1L) <a name="lbAO"></a></p>
<h4>URL</h4>
<p>The Info-ZIP home page is currently at </p>
<pre><a href="http://linux.about.com/gi/dynamic/offsite.htm?site=http://www.info%2Dzip.org/pub/infozip/">http://www.info-zip.org/pub/infozip/</a></pre>
<p>or </p>
<pre><a href="ftp://ftp.info-zip.org/pub/infozip/">ftp://ftp.info-zip.org/pub/infozip/</a> .</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-command-unzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix Command: tar</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-command-tar/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-command-tar/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 04:49:27 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-command-tar/</guid>
		<description><![CDATA[&#160; Source: http://linux.about.com/od/commands/l/blcmdl1_tar.htm &#160; NAME tar &#8211; The GNU version of the tar archiving utility SYNOPSIS tar [ - ] A &#8211;catenate &#8211;concatenate &#124; c &#8211;create &#124; d &#8211;diff &#8211;compare &#124; r &#8211;append &#124; t &#8211;list &#124; u &#8211;update &#124; x -extract &#8211;get [ --atime-preserve ] [ -b, --block-size N ] [ -B, --read-full-blocks ] [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://linux.about.com/od/commands/l/blcmdl1_tar.htm" href="http://linux.about.com/od/commands/l/blcmdl1_tar.htm" target="_blank">http://linux.about.com/od/commands/l/blcmdl1_tar.htm</a></p>
<p>&#160;</p>
<h4>NAME</h4>
<p> tar &#8211; The GNU version of the tar archiving utility <a name="lbAC"></a><br />
<h4>SYNOPSIS</h4>
<p> <b>tar</b> [ <b>-</b> ] <b>A &#8211;catenate &#8211;concatenate | c &#8211;create | d &#8211;diff &#8211;compare | r &#8211;append | t &#8211;list | u &#8211;update | x -extract &#8211;get</b> [ <b>--atime-preserve</b> ] [ <b>-b, --block-size N</b> ] [ <b>-B, --read-full-blocks</b> ] [ <b>-C, --directory DIR</b> ] [ <b>--checkpoint<tt> </tt></b>]  <br />[ <b>-f, --file [HOSTNAME:]F</b> ] [ <b>--force-local<tt> </tt></b>]  <br />[ <b>-F, --info-script F --new-volume-script F</b> ] [ <b>-G, --incremental</b> ] [ <b>-g, --listed-incremental F</b> ] [ <b>-h, --dereference</b> ] [ <b>-i, --ignore-zeros</b> ] [ <b>-j, -I, --bzip</b> ] [ <b>--ignore-failed-read</b> ] [ <b>-k, --keep-old-files</b> ] [ <b>-K, --starting-file F</b> ] [ <b>-l, --one-file-system</b> ] [ <b>-L, --tape-length N</b> ] [ <b>-m, --modification-time</b> ] [ <b>-M, --multi-volume</b> ] [ <b>-N, --after-date DATE, --newer DATE</b> ] [ <b>-o, --old-archive, --portability</b> ] [ <b>-O, --to-stdout</b> ] [ <b>-p, --same-permissions, --preserve-permissions</b> ] [ <b>-P, --absolute-paths</b> ] [ <b>--preserve<tt> </tt></b>]  <br />[ <b>-R, --record-number</b> ] [ <b>--remove-files</b> ] [ <b>-s, --same-order, --preserve-order</b> ] [ <b>--same-owner</b> ] [ <b>-S, --sparse</b> ] [ <b>-T, --files-from=F</b> ] [ <b>--null<tt> </tt></b>]  <br />[ <b>--totals<tt> </tt></b>]  <br />[ <b>-v, --verbose</b> ] [ <b>-V, --label NAME</b> ] [ <b>--version<tt> </tt></b>]  <br />[ <b>-w, --interactive, --confirmation</b> ] [ <b>-W, --verify<tt> </tt></b>]  <br />[ <b>--exclude FILE</b> ] [ <b>-X, --exclude-from FILE</b> ] [ <b>-Z, --compress, --uncompress</b> ] [ <b>-z, --gzip, --ungzip<tt> </tt></b>]  <br />[ <b>--use-compress-program PROG</b> ] [ <b>--block-compress</b> ] [ <b>-[0-7][lmh]<tt> </tt></b>]
<dl compact="compact">
<dt><i>filename1 [ filename2, ... filenameN ] </i></dt>
<dd></dd>
<dt><i>directory1 [ directory2, ...directoryN ]</i></dt>
<dd></dd>
</dl>
<p><a name="lbAD"></a><br />
<h4>DESCRIPTION</h4>
<p>This manual page documents the GNU version of <b>tar</b> , an archiving program designed to store and extract files from an archive file known as a <i>tarfile.</i> A <i>tarfile</i> may be made on a tape drive, however, it is also common to write a <i>tarfile</i> to a normal file. The first argument to <b>tar</b> must be one of the options: <b>Acdrtux</b>, followed by any optional functions. The final arguments to <b>tar</b> are the names of the files or directories which should be archived. The use of a directory name always implies that the subdirectories below should be included in the archive. <a name="lbAE"></a></p>
<h4>FUNCTION LETTERS</h4>
<dl compact="compact">
<dt><b>One of the following options must be used:</b></dt>
<dd></dd>
<dt><b>-A, &#8211;catenate, &#8211;concatenate</b></dt>
<dd>append tar files to an archive </dd>
<dt><b>-c, &#8211;create<tt> </tt></b></dt>
<dd>create a new archive     </dd>
<dt><b>-d, &#8211;diff, &#8211;compare</b></dt>
<dd>find differences between archive and file system </dd>
<dt><b>&#8211;delete<tt> </tt><tt></tt></b></dt>
<dd>delete from the archive (not for use on mag tapes!)     </dd>
<dt><b>-r, &#8211;append<tt> </tt><tt></tt></b></dt>
<dd>append files to the end of an archive     </dd>
<dt><b>-t, &#8211;list<tt> </tt><tt></tt></b></dt>
<dd>list the contents of an archive     </dd>
<dt><b>-u, &#8211;update<tt> </tt><tt></tt></b></dt>
<dd>only append files that are newer than copy in archive     </dd>
<dt><b>-x, &#8211;extract, &#8211;get<tt> </tt><tt></tt></b></dt>
<dd>extract files from an archive</dd>
</dl>
<p><a name="lbAF"></a><br />
<h4>OTHER OPTIONS</h4>
<dl compact="compact">
<dt><b>&#8211;atime-preserve<tt> </tt></b></dt>
<dd>don&#8217;t change access times on dumped files     </dd>
<dt><b>-b, &#8211;block-size N<tt> </tt></b></dt>
<dd>block size of Nx512 bytes (default N=20)     </dd>
<dt><b>-B, &#8211;read-full-blocks<tt> </tt></b></dt>
<dd>reblock as we read (for reading 4.2BSD pipes)     </dd>
<dt><b>-C, &#8211;directory DIR<tt> </tt></b></dt>
<dd>change to directory DIR     </dd>
<dt><b>&#8211;checkpoint<tt> </tt><tt></tt></b></dt>
<dd>print directory names while reading the archive     </dd>
<dt><b>-f, &#8211;file [HOSTNAME:]F<tt> </tt></b></dt>
<dd>use archive file or device F (default /dev/rmt0)     </dd>
<dt><b>&#8211;force-local<tt> </tt><tt></tt></b></dt>
<dd>archive file is local even if has a colon     </dd>
<dt><b>-F, &#8211;info-script F &#8211;new-volume-script F </b></dt>
<dd>run script at end of each tape (implies -M) </dd>
<dt><b>-G, &#8211;incremental<tt> </tt></b></dt>
<dd>create/list/extract old GNU-format incremental backup     </dd>
<dt><b>-g, &#8211;listed-incremental F </b></dt>
<dd>create/list/extract new GNU-format incremental backup </dd>
<dt><b>-h, &#8211;dereference<tt> </tt></b></dt>
<dd>don&#8217;t dump symlinks; dump the files they point to     </dd>
<dt><b>-i, &#8211;ignore-zeros<tt> </tt></b></dt>
<dd>ignore blocks of zeros in archive (normally mean EOF)     </dd>
<dt><b>-j, -I, &#8211;bzip</b></dt>
<dd>filter the archive through bzip2. Note: -I is deprecated and may get a different meaning in the near future. </dd>
<dt><b>&#8211;ignore-failed-read<tt> </tt></b></dt>
<dd>don&#8217;t exit with non-zero status on unreadable files     </dd>
<dt><b>-k, &#8211;keep-old-files<tt> </tt></b></dt>
<dd>keep existing files; don&#8217;t overwrite them from archive     </dd>
<dt><b>-K, &#8211;starting-file F<tt> </tt></b></dt>
<dd>begin at file F in the archive     </dd>
<dt><b>-l, &#8211;one-file-system<tt> </tt></b></dt>
<dd>stay in local file system when creating an archive     </dd>
<dt><b>-L, &#8211;tape-length N<tt> </tt></b></dt>
<dd>change tapes after writing N*1024 bytes     </dd>
<dt><b>-m, &#8211;modification-time<tt> </tt></b></dt>
<dd>don&#8217;t extract file modified time     </dd>
<dt><b>-M, &#8211;multi-volume<tt> </tt></b></dt>
<dd>create/list/extract multi-volume archive     </dd>
<dt><b>-N, &#8211;after-date DATE, &#8211;newer DATE<tt> </tt></b></dt>
<dd>only store files newer than DATE     </dd>
<dt><b>-o, &#8211;old-archive, &#8211;portability<tt> </tt></b></dt>
<dd>write a V7 format archive, rather than ANSI format     </dd>
<dt><b>-O, &#8211;to-stdout<tt> </tt><tt></tt></b></dt>
<dd>extract files to standard output     </dd>
<dt><b>-p, &#8211;same-permissions, &#8211;preserve-permissions </b></dt>
<dd>extract all protection information </dd>
<dt><b>-P, &#8211;absolute-paths<tt> </tt></b></dt>
<dd>don&#8217;t strip leading `/&#8217;s from file names     </dd>
<dt><b>&#8211;preserve<tt> </tt><tt></tt></b></dt>
<dd>like -p -s     </dd>
<dt><b>-R, &#8211;record-number<tt> </tt></b></dt>
<dd>show record number within archive with each message     </dd>
<dt><b>&#8211;remove-files<tt> </tt><tt></tt></b></dt>
<dd>remove files after adding them to the archive     </dd>
<dt><b>-s, &#8211;same-order, &#8211;preserve-order<tt> </tt></b></dt>
<dd>list of names to extract is sorted to match archive     </dd>
<dt><b>&#8211;same-owner<tt> </tt><tt></tt></b></dt>
<dd>create extracted files with the same ownership      </dd>
<dt><b>-S, &#8211;sparse<tt> </tt><tt></tt></b></dt>
<dd>handle sparse files efficiently     </dd>
<dt><b>-T, &#8211;files-from=F<tt> </tt></b></dt>
<dd>get names to extract or create from file F     </dd>
<dt><b>&#8211;null<tt> </tt><tt></tt><tt></tt></b></dt>
<dd>-T reads null-terminated names, disable -C     </dd>
<dt><b>&#8211;totals<tt> </tt><tt></tt></b></dt>
<dd>print total bytes written with &#8211;create     </dd>
<dt><b>-v, &#8211;verbose<tt> </tt><tt></tt></b></dt>
<dd>verbosely list files processed     </dd>
<dt><b>-V, &#8211;label NAME<tt> </tt></b></dt>
<dd>create archive with volume name NAME     </dd>
<dt><b>&#8211;version<tt> </tt><tt></tt></b></dt>
<dd>print tar program version number     </dd>
<dt><b>-w, &#8211;interactive, &#8211;confirmation<tt> </tt></b></dt>
<dd>ask for confirmation for every action     </dd>
<dt><b>-W, &#8211;verify<tt> </tt><tt></tt></b></dt>
<dd>attempt to verify the archive after writing it     </dd>
<dt><b>&#8211;exclude FILE<tt> </tt><tt></tt></b></dt>
<dd>exclude file FILE     </dd>
<dt><b>-X, &#8211;exclude-from FILE<tt> </tt></b></dt>
<dd>exclude files listed in FILE     </dd>
<dt><b>-Z, &#8211;compress, &#8211;uncompress <tt></tt></b></dt>
<dd>filter the archive through compress     </dd>
<dt><b>-z, &#8211;gzip, &#8211;ungzip<tt> </tt><tt></tt></b></dt>
<dd>filter the archive through gzip     </dd>
<dt><b>&#8211;use-compress-program PROG</b></dt>
<dd>filter the archive through PROG (which must accept -d) </dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-command-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix Command: gzip</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip-2/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip-2/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 04:46:29 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip-2/</guid>
		<description><![CDATA[&#160; Source: http://linux.about.com/od/commands/l/blcmdl1_gzip.htm &#160; NAME gzip, gunzip, zcat &#8211; compress or expand files SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] zcat [ -fhLV ] [ name ... ] DESCRIPTION Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://linux.about.com/od/commands/l/blcmdl1_gzip.htm" href="http://linux.about.com/od/commands/l/blcmdl1_gzip.htm" target="_blank">http://linux.about.com/od/commands/l/blcmdl1_gzip.htm</a></p>
<p>&#160;</p>
<h4>NAME</h4>
<p> gzip, gunzip, zcat &#8211; compress or expand files <a name="lbAC"></a><br />
<h4>SYNOPSIS</h4>
<p> <b>gzip</b> [<b> -acdfhlLnNrtvV19 </b>] [<b>-S suffix</b>] [ <i>name ...</i> ]   <br /><b>gunzip</b> [<b> -acfhlLnNrtvV </b>] [<b>-S suffix</b>] [ <i>name ...</i> ]   <br /><b>zcat</b> [<b> -fhLV </b>] [ <i>name ...</i> ] <a name="lbAD"></a><br />
<h4>DESCRIPTION</h4>
<p><i>Gzip</i> reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension <b>.gz,</b> while keeping the same ownership modes, access and modification times. (The default extension is <b>-gz</b> for VMS, <b>z</b> for MSDOS, OS/2 FAT, Windows NT FAT and Atari.) If no files are specified, or if a file name is &quot;-&quot;, the standard input is compressed to the standard output. <i>Gzip</i> will only attempt to compress regular files. In particular, it will ignore symbolic links.</p>
<p>&#160;</p>
<p>If the compressed file name is too long for its file system, <i>gzip</i> truncates it. <i>Gzip</i> attempts to truncate only the parts of the file name longer than 3 characters. (A part is delimited by dots.) If the name consists of small parts only, the longest parts are truncated. For example, if file names are limited to 14 characters, gzip.msdos.exe is compressed to gzi.msd.exe.gz. Names are not truncated on systems which do not have a limit on file name length. </p>
<p>By default, <i>gzip</i> keeps the original file name and timestamp in the compressed file. These are used when decompressing the file with the <b>-N</b> option. This is useful when the compressed file name was truncated or when the time stamp was not preserved after a file transfer. </p>
<p>Compressed files can be restored to their original form using <i>gzip -d</i> or <i>gunzip</i> or <i>zcat.</i> If the original name saved in the compressed file is not suitable for its file system, a new name is constructed from the original one to make it legal. </p>
<p><i>gunzip</i> takes a list of files on its command line and replaces each file whose name ends with .gz, -gz, .z, -z, _z or .Z and which begins with the correct magic number with an uncompressed file without the original extension. <i>gunzip</i> also recognizes the special extensions <b>.tgz</b> and <b>.taz</b> as shorthands for <b>.tar.gz</b> and <b>.tar.Z</b> respectively. When compressing, <i>gzip</i> uses the <b>.tgz</b> extension if necessary instead of truncating a file with a <b>.tar</b> extension. </p>
<p><i>gunzip</i> can currently decompress files created by <i>gzip, zip, compress, compress -H</i> or <i>pack.</i> The detection of the input format is automatic. When using the first two formats, <i>gunzip</i> checks a 32 bit CRC. For <i>pack, gunzip</i> checks the uncompressed length. The standard <i>compress</i> format was not designed to allow consistency checks. However <i>gunzip</i> is sometimes able to detect a bad .Z file. If you get an error when uncompressing a .Z file, do not assume that the .Z file is correct simply because the standard <i>uncompress</i> does not complain. This generally means that the standard <i>uncompress</i> does not check its input, and happily generates garbage output. The SCO compress -H format (lzh compression method) does not include a CRC but also allows some consistency checks. </p>
<p>Files created by <i>zip</i> can be uncompressed by gzip only if they have a single member compressed with the &#8216;deflation&#8217; method. This feature is only intended to help conversion of tar.zip files to the tar.gz format. To extract zip files with several members, use <i>unzip</i> instead of <i>gunzip.</i></p>
<p><i>zcat</i> is identical to <i>gunzip</i> <b>-c.</b> (On some systems, <i>zcat</i> may be installed as <i>gzcat</i> to preserve the original link to <i>compress.)</i> <i>zcat</i> uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output. <i>zcat</i> will uncompress files that have the correct magic number whether they have a <b>.gz</b> suffix or not. </p>
<p><i>Gzip</i> uses the Lempel-Ziv algorithm used in <i>zip</i> and PKZIP. The amount of compression obtained depends on the size of the input and the distribution of common substrings. Typically, text such as source code or English is reduced by 60-70%. Compression is generally much better than that achieved by LZW (as used in <i>compress</i>), Huffman coding (as used in <i>pack</i>), or adaptive Huffman coding (<i>compact</i>). </p>
<p>Compression is always performed, even if the compressed file is slightly larger than the original. The worst case expansion is a few bytes for the gzip file header, plus 5 bytes every 32K block, or an expansion ratio of 0.015% for large files. Note that the actual number of used disk blocks almost never increases. <i>gzip</i> preserves the mode, ownership and timestamps of files when compressing or decompressing. </p>
<p><a name="lbAE"></a></p>
<h4>OPTIONS</h4>
<dl compact="compact">
<dt><b>-a &#8211;ascii</b></dt>
<dd>Ascii text mode: convert end-of-lines using local conventions. This option is supported only on some non-Unix systems. For MSDOS, CR LF is converted to LF when compressing, and LF is converted to CR LF when decompressing. </dd>
<dt><b>-c &#8211;stdout &#8211;to-stdout</b></dt>
<dd>Write output on standard output; keep original files unchanged. If there are several input files, the output consists of a sequence of independently compressed members. To obtain better compression, concatenate all input files before compressing them. </dd>
<dt><b>-d &#8211;decompress &#8211;uncompress</b></dt>
<dd>Decompress. </dd>
<dt><b>-f &#8211;force</b></dt>
<dd>Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data is read from or written to a terminal. If the input data is not in a format recognized by <i>gzip,</i> and if the option &#8211;stdout is also given, copy the input data without change to the standard ouput: let <i>zcat</i> behave as <i>cat.</i> If <b>-f</b> is not given, and when not running in the background, <i>gzip</i> prompts to verify whether an existing file should be overwritten. </dd>
<dt><b>-h &#8211;help</b></dt>
<dd>Display a help screen and quit. </dd>
<dt><b>-l &#8211;list</b></dt>
<dd>For each compressed file, list the following fields:
<p>compressed size: size of the compressed file        <br />uncompressed size: size of the uncompressed file         <br />ratio: compression ratio (0.0% if unknown)         <br />uncompressed_name: name of the uncompressed file </p>
<p>The uncompressed size is given as -1 for files not in gzip format, such as compressed .Z files. To get the uncompressed size for such a file, you can use: </p>
<p>zcat file.Z | wc -c </p>
<p>In combination with the &#8211;verbose option, the following fields are also displayed: </p>
<p>method: compression method        <br />crc: the 32-bit CRC of the uncompressed data         <br />date &amp; time: time stamp for the uncompressed file </p>
<p>The compression methods currently supported are deflate, compress, lzh (SCO compress -H) and pack. The crc is given as ffffffff for a file not in gzip format. </p>
<p>With &#8211;name, the uncompressed name, date and time are those stored within the compress file if present. </p>
<p>With &#8211;verbose, the size totals and compression ratio for all files is also displayed, unless some sizes are unknown. With &#8211;quiet, the title and totals lines are not displayed. </p>
</p>
</dd>
<dt><b>-L &#8211;license</b></dt>
<dd>Display the <i>gzip</i> license and quit. </dd>
<dt><b>-n &#8211;no-name</b></dt>
<dd>When compressing, do not save the original file name and time stamp by default. (The original name is always saved if the name had to be truncated.) When decompressing, do not restore the original file name if present (remove only the <i>gzip</i> suffix from the compressed file name) and do not restore the original time stamp if present (copy it from the compressed file). This option is the default when decompressing. </dd>
<dt><b>-N &#8211;name</b></dt>
<dd>When compressing, always save the original file name and time stamp; this is the default. When decompressing, restore the original file name and time stamp if present. This option is useful on systems which have a limit on file name length or when the time stamp has been lost after a file transfer. </dd>
<dt><b>-q &#8211;quiet</b></dt>
<dd>Suppress all warnings. </dd>
<dt><b>-r &#8211;recursive</b></dt>
<dd>Travel the directory structure recursively. If any of the file names specified on the command line are directories, <i>gzip</i> will descend into the directory and compress all the files it finds there (or decompress them in the case of <i>gunzip</i> ). </dd>
<dt><b>-S .suf &#8211;suffix .suf</b></dt>
<dd>Use suffix .suf instead of .gz. Any suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files are transferred to other systems. A null suffix forces gunzip to try decompression on all given files regardless of suffix, as in:
<p>gunzip -S &quot;&quot; * (*.* for MSDOS) </p>
<p>Previous versions of gzip used the .z suffix. This was changed to avoid a conflict with <i><a href="http://linux.about.com/library/cmd/blcmdl1_pack.htm">pack</a></i>(1). </p>
</p>
</dd>
<dt><b>-t &#8211;test</b></dt>
<dd>Test. Check the compressed file integrity. </dd>
<dt><b>-v &#8211;verbose</b></dt>
<dd>Verbose. Display the name and percentage reduction for each file compressed or decompressed. </dd>
<dt><b>-V &#8211;version</b></dt>
<dd>Version. Display the version number and compilation options then quit. </dd>
<dt><b>-# &#8211;fast &#8211;best</b></dt>
<dd>Regulate the speed of compression using the specified digit <i>#</i>, where <b>-1</b> or <b>&#8211;fast</b> indicates the fastest compression method (less compression) and <b>-9</b> or <b>&#8211;best</b> indicates the slowest compression method (best compression). The default compression level is <b>-6</b> (that is, biased towards high compression at expense of speed). </dd>
</dl>
<p><a name="lbAF"></a><br />
<h4>ADVANCED USAGE</h4>
<p> Multiple compressed files can be concatenated. In this case, <i>gunzip</i> will extract all members at once. For example:
<p>gzip -c file1 &gt; foo.gz    <br />gzip -c file2 &gt;&gt; foo.gz </p>
<p>Then </p>
<p>gunzip -c foo </p>
<p>is equivalent to </p>
<p>cat file1 file2 </p>
<p>In case of damage to one member of a .gz file, other members can still be recovered (if the damaged member is removed). However, you can get better compression by compressing all members at once: </p>
<p>cat file1 file2 | gzip &gt; foo.gz </p>
<p>compresses better than </p>
<p>gzip -c file1 file2 &gt; foo.gz </p>
<p>If you want to recompress concatenated files to get better compression, do: </p>
<p>gzip -cd old.gz | gzip &gt; new.gz </p>
<p>If a compressed file consists of several members, the uncompressed size and CRC reported by the &#8211;list option applies to the last member only. If you need the uncompressed size for all members, you can use: </p>
<p>gzip -cd file.gz | wc -c </p>
<p>If you wish to create a single archive file with multiple members so that members can later be extracted independently, use an archiver such as tar or zip. GNU tar supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix Command: gzip</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 04:30:16 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip/</guid>
		<description><![CDATA[&#160; Source: http://linux.about.com/od/commands/l/blcmdl1_gzip.htm &#160; NAME gzip, gunzip, zcat &#8211; compress or expand files SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] zcat [ -fhLV ] [ name ... ] DESCRIPTION Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://linux.about.com/od/commands/l/blcmdl1_gzip.htm" href="http://linux.about.com/od/commands/l/blcmdl1_gzip.htm" target="_blank">http://linux.about.com/od/commands/l/blcmdl1_gzip.htm</a></p>
<p>&#160;</p>
<h4>NAME</h4>
<p> gzip, gunzip, zcat &#8211; compress or expand files <a name="lbAC"></a><br />
<h4>SYNOPSIS</h4>
<p> <b>gzip</b> [<b> -acdfhlLnNrtvV19 </b>] [<b>-S suffix</b>] [ <i>name ...</i> ]   <br /><b>gunzip</b> [<b> -acfhlLnNrtvV </b>] [<b>-S suffix</b>] [ <i>name ...</i> ]   <br /><b>zcat</b> [<b> -fhLV </b>] [ <i>name ...</i> ] <a name="lbAD"></a><br />
<h4>DESCRIPTION</h4>
<p><i>Gzip</i> reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension <b>.gz,</b> while keeping the same ownership modes, access and modification times. (The default extension is <b>-gz</b> for VMS, <b>z</b> for MSDOS, OS/2 FAT, Windows NT FAT and Atari.) If no files are specified, or if a file name is &quot;-&quot;, the standard input is compressed to the standard output. <i>Gzip</i> will only attempt to compress regular files. In particular, it will ignore symbolic links.</p>
<p>&#160;</p>
<p>If the compressed file name is too long for its file system, <i>gzip</i> truncates it. <i>Gzip</i> attempts to truncate only the parts of the file name longer than 3 characters. (A part is delimited by dots.) If the name consists of small parts only, the longest parts are truncated. For example, if file names are limited to 14 characters, gzip.msdos.exe is compressed to gzi.msd.exe.gz. Names are not truncated on systems which do not have a limit on file name length. </p>
<p>By default, <i>gzip</i> keeps the original file name and timestamp in the compressed file. These are used when decompressing the file with the <b>-N</b> option. This is useful when the compressed file name was truncated or when the time stamp was not preserved after a file transfer. </p>
<p>Compressed files can be restored to their original form using <i>gzip -d</i> or <i>gunzip</i> or <i>zcat.</i> If the original name saved in the compressed file is not suitable for its file system, a new name is constructed from the original one to make it legal. </p>
<p><i>gunzip</i> takes a list of files on its command line and replaces each file whose name ends with .gz, -gz, .z, -z, _z or .Z and which begins with the correct magic number with an uncompressed file without the original extension. <i>gunzip</i> also recognizes the special extensions <b>.tgz</b> and <b>.taz</b> as shorthands for <b>.tar.gz</b> and <b>.tar.Z</b> respectively. When compressing, <i>gzip</i> uses the <b>.tgz</b> extension if necessary instead of truncating a file with a <b>.tar</b> extension. </p>
<p><i>gunzip</i> can currently decompress files created by <i>gzip, zip, compress, compress -H</i> or <i>pack.</i> The detection of the input format is automatic. When using the first two formats, <i>gunzip</i> checks a 32 bit CRC. For <i>pack, gunzip</i> checks the uncompressed length. The standard <i>compress</i> format was not designed to allow consistency checks. However <i>gunzip</i> is sometimes able to detect a bad .Z file. If you get an error when uncompressing a .Z file, do not assume that the .Z file is correct simply because the standard <i>uncompress</i> does not complain. This generally means that the standard <i>uncompress</i> does not check its input, and happily generates garbage output. The SCO compress -H format (lzh compression method) does not include a CRC but also allows some consistency checks. </p>
<p>Files created by <i>zip</i> can be uncompressed by gzip only if they have a single member compressed with the &#8216;deflation&#8217; method. This feature is only intended to help conversion of tar.zip files to the tar.gz format. To extract zip files with several members, use <i>unzip</i> instead of <i>gunzip.</i></p>
<p><i>zcat</i> is identical to <i>gunzip</i> <b>-c.</b> (On some systems, <i>zcat</i> may be installed as <i>gzcat</i> to preserve the original link to <i>compress.)</i> <i>zcat</i> uncompresses either a list of files on the command line or its standard input and writes the uncompressed data on standard output. <i>zcat</i> will uncompress files that have the correct magic number whether they have a <b>.gz</b> suffix or not. </p>
<p><i>Gzip</i> uses the Lempel-Ziv algorithm used in <i>zip</i> and PKZIP. The amount of compression obtained depends on the size of the input and the distribution of common substrings. Typically, text such as source code or English is reduced by 60-70%. Compression is generally much better than that achieved by LZW (as used in <i>compress</i>), Huffman coding (as used in <i>pack</i>), or adaptive Huffman coding (<i>compact</i>). </p>
<p>Compression is always performed, even if the compressed file is slightly larger than the original. The worst case expansion is a few bytes for the gzip file header, plus 5 bytes every 32K block, or an expansion ratio of 0.015% for large files. Note that the actual number of used disk blocks almost never increases. <i>gzip</i> preserves the mode, ownership and timestamps of files when compressing or decompressing. </p>
<p><a name="lbAE"></a></p>
<h4>OPTIONS</h4>
<dl compact="compact">
<dt><b>-a &#8211;ascii</b></dt>
<dd>Ascii text mode: convert end-of-lines using local conventions. This option is supported only on some non-Unix systems. For MSDOS, CR LF is converted to LF when compressing, and LF is converted to CR LF when decompressing. </dd>
<dt><b>-c &#8211;stdout &#8211;to-stdout</b></dt>
<dd>Write output on standard output; keep original files unchanged. If there are several input files, the output consists of a sequence of independently compressed members. To obtain better compression, concatenate all input files before compressing them. </dd>
<dt><b>-d &#8211;decompress &#8211;uncompress</b></dt>
<dd>Decompress. </dd>
<dt><b>-f &#8211;force</b></dt>
<dd>Force compression or decompression even if the file has multiple links or the corresponding file already exists, or if the compressed data is read from or written to a terminal. If the input data is not in a format recognized by <i>gzip,</i> and if the option &#8211;stdout is also given, copy the input data without change to the standard ouput: let <i>zcat</i> behave as <i>cat.</i> If <b>-f</b> is not given, and when not running in the background, <i>gzip</i> prompts to verify whether an existing file should be overwritten. </dd>
<dt><b>-h &#8211;help</b></dt>
<dd>Display a help screen and quit. </dd>
<dt><b>-l &#8211;list</b></dt>
<dd>For each compressed file, list the following fields:
<p>compressed size: size of the compressed file        <br />uncompressed size: size of the uncompressed file         <br />ratio: compression ratio (0.0% if unknown)         <br />uncompressed_name: name of the uncompressed file </p>
<p>The uncompressed size is given as -1 for files not in gzip format, such as compressed .Z files. To get the uncompressed size for such a file, you can use: </p>
<p>zcat file.Z | wc -c </p>
<p>In combination with the &#8211;verbose option, the following fields are also displayed: </p>
<p>method: compression method        <br />crc: the 32-bit CRC of the uncompressed data         <br />date &amp; time: time stamp for the uncompressed file </p>
<p>The compression methods currently supported are deflate, compress, lzh (SCO compress -H) and pack. The crc is given as ffffffff for a file not in gzip format. </p>
<p>With &#8211;name, the uncompressed name, date and time are those stored within the compress file if present. </p>
<p>With &#8211;verbose, the size totals and compression ratio for all files is also displayed, unless some sizes are unknown. With &#8211;quiet, the title and totals lines are not displayed. </p>
</p>
</dd>
<dt><b>-L &#8211;license</b></dt>
<dd>Display the <i>gzip</i> license and quit. </dd>
<dt><b>-n &#8211;no-name</b></dt>
<dd>When compressing, do not save the original file name and time stamp by default. (The original name is always saved if the name had to be truncated.) When decompressing, do not restore the original file name if present (remove only the <i>gzip</i> suffix from the compressed file name) and do not restore the original time stamp if present (copy it from the compressed file). This option is the default when decompressing. </dd>
<dt><b>-N &#8211;name</b></dt>
<dd>When compressing, always save the original file name and time stamp; this is the default. When decompressing, restore the original file name and time stamp if present. This option is useful on systems which have a limit on file name length or when the time stamp has been lost after a file transfer. </dd>
<dt><b>-q &#8211;quiet</b></dt>
<dd>Suppress all warnings. </dd>
<dt><b>-r &#8211;recursive</b></dt>
<dd>Travel the directory structure recursively. If any of the file names specified on the command line are directories, <i>gzip</i> will descend into the directory and compress all the files it finds there (or decompress them in the case of <i>gunzip</i> ). </dd>
<dt><b>-S .suf &#8211;suffix .suf</b></dt>
<dd>Use suffix .suf instead of .gz. Any suffix can be given, but suffixes other than .z and .gz should be avoided to avoid confusion when files are transferred to other systems. A null suffix forces gunzip to try decompression on all given files regardless of suffix, as in:
<p>gunzip -S &quot;&quot; * (*.* for MSDOS) </p>
<p>Previous versions of gzip used the .z suffix. This was changed to avoid a conflict with <i><a href="http://linux.about.com/library/cmd/blcmdl1_pack.htm">pack</a></i>(1). </p>
</p>
</dd>
<dt><b>-t &#8211;test</b></dt>
<dd>Test. Check the compressed file integrity. </dd>
<dt><b>-v &#8211;verbose</b></dt>
<dd>Verbose. Display the name and percentage reduction for each file compressed or decompressed. </dd>
<dt><b>-V &#8211;version</b></dt>
<dd>Version. Display the version number and compilation options then quit. </dd>
<dt><b>-# &#8211;fast &#8211;best</b></dt>
<dd>Regulate the speed of compression using the specified digit <i>#</i>, where <b>-1</b> or <b>&#8211;fast</b> indicates the fastest compression method (less compression) and <b>-9</b> or <b>&#8211;best</b> indicates the slowest compression method (best compression). The default compression level is <b>-6</b> (that is, biased towards high compression at expense of speed). </dd>
</dl>
<p><a name="lbAF"></a><br />
<h4>ADVANCED USAGE</h4>
<p> Multiple compressed files can be concatenated. In this case, <i>gunzip</i> will extract all members at once. For example:
<p>gzip -c file1 &gt; foo.gz    <br />gzip -c file2 &gt;&gt; foo.gz </p>
<p>Then </p>
<p>gunzip -c foo </p>
<p>is equivalent to </p>
<p>cat file1 file2 </p>
<p>In case of damage to one member of a .gz file, other members can still be recovered (if the damaged member is removed). However, you can get better compression by compressing all members at once: </p>
<p>cat file1 file2 | gzip &gt; foo.gz </p>
<p>compresses better than </p>
<p>gzip -c file1 file2 &gt; foo.gz </p>
<p>If you want to recompress concatenated files to get better compression, do: </p>
<p>gzip -cd old.gz | gzip &gt; new.gz </p>
<p>If a compressed file consists of several members, the uncompressed size and CRC reported by the &#8211;list option applies to the last member only. If you need the uncompressed size for all members, you can use: </p>
<p>gzip -cd file.gz | wc -c </p>
<p>If you wish to create a single archive file with multiple members so that members can later be extracted independently, use an archiver such as tar or zip. GNU tar supports the -z option to invoke gzip transparently. gzip is designed as a complement to tar, not as a replacement. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-command-gzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix Command: zip</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-command-zip/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-command-zip/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 04:26:54 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-command-zip/</guid>
		<description><![CDATA[&#160; Source: http://linux.about.com/od/commands/l/blcmdl1_zip.htm &#160; zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [-b path] [-n suffixes] [-t mmddyyyy] [-tt mmddyyyy] [ zipfile [ file1 file2 ...]] [-xi list] zipcloak [-dhL] [-b path] zipfile zipnote [-hwL] [-b path] zipfile zipsplit [-hiLpst] [-n size] [-b path] zipfile DESCRIPTION zip is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://linux.about.com/od/commands/l/blcmdl1_zip.htm" href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm" target="_blank">http://linux.about.com/od/commands/l/blcmdl1_zip.htm</a></p>
<p>&#160;</p>
<p><b>zip</b> [<b>-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$</b>] [<b>-b path</b>] [<b>-n suffixes</b>] [<b>-t mmddyyyy</b>] [<b>-tt mmddyyyy</b>] <i>[ zipfile</i> <i>[ file1</i> <i>file2</i> ...<i>]]</i> [<b>-xi list</b>] </p>
<p><b>zipcloak</b> [<b>-dhL</b>] [<b>-b path</b>] <i>zipfile</i></p>
<p><b>zipnote</b> [<b>-hwL</b>] [<b>-b path</b>] <i>zipfile</i></p>
<p><b>zipsplit</b> [<b>-hiLpst</b>] [<b>-n size</b>] [<b>-b path</b>] <i>zipfile</i> <a name="lbAD"></a></p>
<h4>DESCRIPTION</h4>
<p><i>zip</i> is a compression and file packaging utility for Unix, VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh, Amiga and Acorn RISC OS.</p>
<p>&#160;</p>
<p>It is analogous to a combination of the UNIX commands <i><a href="http://linux.about.com/library/cmd/blcmdl1_tar.htm">tar</a></i>(1) and <i><a href="http://linux.about.com/library/cmd/blcmdl1_compress.htm">compress</a></i>(1) and is compatible with PKZIP (Phil Katz&#8217;s ZIP for MSDOS systems). </p>
<p>A companion program (<i><a href="http://linux.about.com/od/commands/l/blcmdl1_unzip.htm">unzip</a></i>(1L)), unpacks <i>zip</i> archives. The <i>zip</i> and <i><a href="http://linux.about.com/od/commands/l/blcmdl1_unzip.htm">unzip</a></i>(1L) programs can work with archives produced by PKZIP, and PKZIP and PKUNZIP can work with archives produced by <i>zip</i>. <i>zip</i> version 2.3 is compatible with PKZIP 2.04. Note that PKUNZIP 1.10 cannot extract files produced by PKZIP 2.04 or <i>zip</i> 2.3. You must use PKUNZIP 2.04g or <i>unzip</i> 5.0p1 (or later versions) to extract them. </p>
<p>For a brief help on <i>zip</i> and <i>unzip,</i> run each without specifying any parameters on the command line. </p>
<p>The program is useful for packaging a set of files for distribution; for archiving files; and for saving disk space by temporarily compressing unused files or directories. </p>
<p>The <i>zip</i> program puts one or more compressed files into a single <i>zip</i> archive, along with information about the files (name, path, date, time of last modification, protection, and check information to verify file integrity). An entire directory structure can be packed into a <i>zip</i> archive with a single command. Compression ratios of 2:1 to 3:1 are common for text files. <i>zip</i> has one compression method (deflation) and can also store files without compression. <i>zip</i> automatically chooses the better of the two for each file to be compressed. </p>
<p>When given the name of an existing <i>zip</i> archive, <i>zip</i> will replace identically named entries in the <i>zip</i> archive or add entries for new names. For example, if <i>foo.zip</i> exists and contains <i>foo/file1</i> and <i>foo/file2</i>, and the directory <i>foo</i> contains the files <i>foo/file1</i> and <i>foo/file3</i>, then: </p>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo foo </dd>
</dl>
<p>will replace <i>foo/file1</i> in <i>foo.zip</i> and add <i>foo/file3</i> to <i>foo.zip</i>. After this, <i>foo.zip</i> contains <i>foo/file1</i>, <i>foo/file2</i>, and <i>foo/file3</i>, with <i>foo/file2</i> unchanged from before. </p>
<p>If the file list is specified as <b>-@</b>, [Not on MacOS] <i>zip</i> takes the list of input files from standard input. Under UNIX, this option can be used to powerful effect in conjunction with the <i><a href="http://linux.about.com/library/cmd/blcmdl1_find.htm">find</a></i>(1) command. For example, to archive all the C source files in the current directory and its subdirectories: </p>
<dl compact="compact">
<dt></dt>
<dd>find . -name &quot;*.[ch]&quot; -print | zip source -@ </dd>
</dl>
<p>(note that the pattern must be quoted to keep the shell from expanding it). <i>zip</i> will also accept a single dash (&quot;-&quot;) 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: </p>
<dl compact="compact">
<dt></dt>
<dd>zip -r &#8211; . | dd of=/dev/nrst0 obs=16k </dd>
</dl>
<p>would write the zip output directly to a tape with the specified block size for the purpose of backing up the current directory. </p>
<p><i>zip</i> also accepts a single dash (&quot;-&quot;) as the name of a file to be compressed, in which case it will read the file from standard input, allowing zip to take input from another program. For example: </p>
<dl compact="compact">
<dt></dt>
<dd>tar cf &#8211; . | zip backup &#8211; </dd>
</dl>
<p>would compress the output of the tar command for the purpose of backing up the current directory. This generally produces better compression than the previous example using the -r option, because <i>zip</i> can take advantage of redundancy between files. The backup can be restored using the command </p>
<dl compact="compact">
<dt></dt>
<dd>unzip -p backup | tar xf &#8211; </dd>
</dl>
<p>When no zip file name is given and stdout is not a terminal, <i>zip</i> acts as a filter, compressing standard input to standard output. For example, </p>
<dl compact="compact">
<dt></dt>
<dd>tar cf &#8211; . | zip | dd of=/dev/nrst0 obs=16k </dd>
</dl>
<p>is equivalent to </p>
<dl compact="compact">
<dt></dt>
<dd>tar cf &#8211; . | zip &#8211; - | dd of=/dev/nrst0 obs=16k </dd>
</dl>
<p><i>zip</i> archives created in this manner can be extracted with the program <i>funzip</i> which is provided in the <i>unzip</i> package, or by <i>gunzip</i> which is provided in the <i>gzip</i> package. For example: </p>
<p>dd if=/dev/nrst0 ibs=16k | funzip | tar xvf &#8211; </p>
<p>When changing an existing <i>zip</i> archive, <i>zip</i> will write a temporary file with the new contents, and only replace the old one when the process of creating the new version has been completed without error. </p>
<p>If the name of the <i>zip</i> archive does not contain an extension, the extension <i>.zip</i> is added. If the name already contains an extension other than <i>.zip</i> the existing extension is kept unchanged. <a name="lbAE"></a></p>
<h4>OPTIONS</h4>
<dl compact="compact">
<dt><b>-a</b></dt>
<dd>[Systems using EBCDIC] Translate file to ASCII format. </dd>
<dt><b>-A</b></dt>
<dd>Adjust self-extracting executable archive. A self-extracting executable archive is created by prepending the SFX stub to an existing archive. The <b>-A</b> option tells <i>zip</i> to adjust the entry offsets stored in the archive to take into account this &quot;preamble&quot; data. </dd>
</dl>
<p>Note: self-extracting archives for the Amiga are a special case. At present, only the Amiga port of Zip is capable of adjusting or updating these without corrupting them. -J can be used to remove the SFX stub if other updates need to be made. </p>
<dl compact="compact">
<dt><b>-B</b></dt>
<dd>[VM/CMS and MVS] force file to be read binary (default is text). </dd>
<dt><b>-Bn</b></dt>
<dd>[TANDEM] set Edit/Enscribe formatting options with n defined as
<dl compact="compact">
<dt></dt>
<dd>bit 0: Don&#8217;t add delimiter (Edit/Enscribe) </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe) </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 2: Space fill record to maximum record length (Enscribe) </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 3: Trim trailing space (Enscribe) </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 8: Force 30K (Expand) large read for unstructured files </dd>
</dl>
</dd>
<dt><b>-b path</b></dt>
<dd>Use the specified <i>path</i> for the temporary <i>zip</i> archive. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -b /tmp stuff * </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will put the temporary <i>zip</i> archive in the directory <i>/tmp</i>, copying over <i>stuff.zip</i> to the current directory when done. This option is only useful when updating an existing archive, and the file system containing this old archive does not have enough space to hold both old and new archives at the same time. </dd>
<dt><b>-c</b></dt>
<dd>Add one-line comments for each file. File operations (adding, updating) are done first, and the user is then prompted for a one-line comment for each file. Enter the comment followed by return, or just return for no comment. </dd>
<dt><b>-d</b></dt>
<dd>Remove (delete) entries from a <i>zip</i> archive. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -d foo foo/tom/junk foo/harry/\* \*.o </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will remove the entry <i>foo/tom/junk</i>, all of the files that start with <i>foo/harry/</i>, and all of the files that end with <i>.o</i> (in any path). Note that shell pathname expansion has been inhibited with backslashes, so that <i>zip</i> can see the asterisks, enabling <i>zip</i> to match on the contents of the <i>zip</i> archive instead of the contents of the current directory. </dd>
<dt></dt>
<dd>Under MSDOS, <b>-d</b> is case sensitive when it matches names in the <i>zip</i> archive. This requires that file names be entered in upper case if they were zipped by PKZIP on an MSDOS system. </dd>
<dt><b>-df</b></dt>
<dd>[MacOS] Include only data-fork of files zipped into the archive. Good for exporting files to foreign operating-systems. Resource-forks will be ignored at all. </dd>
<dt><b>-D</b></dt>
<dd>Do not create entries in the <i>zip</i> archive for directories. Directory entries are created by default so that their attributes can be saved in the zip archive. The environment variable ZIPOPT can be used to change the default options. For example under Unix with sh:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>ZIPOPT=&quot;-D&quot;; export ZIPOPT </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>(The variable ZIPOPT can be used for any option except <b>-i</b> and <b>-x</b> and can include several options.) The option <b>-D</b> is a shorthand for <b>-x</b> &quot;*/&quot; but the latter cannot be set as default in the ZIPOPT environment variable. </dd>
<dt><b>-e</b></dt>
<dd>Encrypt the contents of the <i>zip</i> archive using a password which is entered on the terminal in response to a prompt (this will not be echoed; if standard error is not a tty, <i>zip</i> will exit with an error). The password prompt is repeated to save the user from typing errors. </dd>
<dt><b>-E</b></dt>
<dd>[OS/2] Use the .LONGNAME Extended Attribute (if found) as filename. </dd>
<dt><b>-f</b></dt>
<dd>Replace (freshen) an existing entry in the <i>zip</i> archive only if it has been modified more recently than the version already in the <i>zip</i> archive; unlike the update option (<b>-u</b>) this will not add files that are not already in the <i>zip</i> archive. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -f foo </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>This command should be run from the same directory from which the original <i>zip</i> command was run, since paths stored in <i>zip</i> archives are always relative. </dd>
<dt></dt>
<dd>Note that the timezone environment variable TZ should be set according to the local timezone in order for the <b>-f</b> , <b>-u</b> and <b>-o</b> options to work correctly. </dd>
<dt></dt>
<dd>The reasons behind this are somewhat subtle but have to do with the differences between the Unix-format file times (always in GMT) and most of the other operating systems (always local time) and the necessity to compare the two. A typical TZ value is &#8220;MET-1MEST&#8221; (Middle European time with automatic adjustment for &#8220;summertime&#8221; or Daylight Savings Time). </dd>
<dt><b>-F</b></dt>
<dd>Fix the <i>zip</i> archive. This option can be used if some portions of the archive are missing. It is not guaranteed to work, so you MUST make a backup of the original archive first. </dd>
<dt></dt>
<dd>When doubled as in <b>-FF</b> the compressed sizes given inside the damaged archive are not trusted and zip scans for special signatures to identify the limits between the archive members. The single <b>-F</b> is more reliable if the archive is not too much damaged, for example if it has only been truncated, so try this option first. </dd>
<dt></dt>
<dd>Neither option will recover archives that have been incorrectly transferred in ascii mode instead of binary. After the repair, the <b>-t</b> option of <i>unzip</i> may show that some files have a bad CRC. Such files cannot be recovered; you can remove them from the archive using the <b>-d</b> option of <i>zip.</i> </dd>
<dt><b>-g</b></dt>
<dd>Grow (append to) the specified <i>zip</i> archive, instead of creating a new one. If this operation fails, <i>zip</i> attempts to restore the archive to its original state. If the restoration fails, the archive might become corrupted. This option is ignored when there&#8217;s no existing archive or when at least one archive member must be updated or deleted. </dd>
<dt><b>-h</b></dt>
<dd>Display the <i>zip</i> help information (this also appears if <i>zip</i> is run with no arguments). </dd>
<dt><b>-i files</b></dt>
<dd>Include only the specified files, as in:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo . -i \*.c </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>which will include only the files that end in <i></i>.c in the current directory and its subdirectories. (Note for PKZIP users: the equivalent command is
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>pkzip -rP foo *.c </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>PKZIP does not allow recursion in directories other than the current one.) The backslash avoids the shell filename substitution, so that the name matching is performed by <i>zip</i> at all directory levels. </dd>
<dt></dt>
<dd>Also possible:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo . <a href="mailto:-i@include.lst">-i@include.lst</a></dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>which will only include the files in the current directory and its subdirectories that match the patterns in the file include.lst. </dd>
<dt><b>-I</b></dt>
<dd>[Acorn RISC OS] Don&#8217;t scan through Image files. When used, zip will not consider Image files (eg. DOS partitions or Spark archives when SparkFS is loaded) as directories but will store them as single files.
<p>For example, if you have SparkFS loaded, zipping a Spark archive will result in a zipfile containing a directory (and its content) while using the &#8216;I&#8217; option will result in a zipfile containing a Spark archive. Obviously this second case will also be obtained (without the &#8216;I&#8217; option) if SparkFS isn&#8217;t loaded. </p>
</p>
</dd>
<dt><b>-j</b></dt>
<dd>Store just the name of a saved file (junk the path), and do not store directory names. By default, <i>zip</i> will store the full path (relative to the current path). </dd>
<dt><b>-jj</b></dt>
<dd>[MacOS] record Fullpath (+ Volname). The complete path including volume will be stored. By default the relative path will be stored. </dd>
<dt><b>-J</b></dt>
<dd>Strip any prepended data (e.g. a SFX stub) from the archive. </dd>
<dt><b>-k</b></dt>
<dd>Attempt to convert the names and paths to conform to MSDOS, store only the MSDOS attribute (just the user write attribute from UNIX), and mark the entry as made under MSDOS (even though it was not); for compatibility with PKUNZIP under MSDOS which cannot handle certain names such as those with two dots. </dd>
<dt><b>-l</b></dt>
<dd>Translate the Unix end-of-line character LF into the MSDOS convention CR LF. This option should not be used on binary files. This option can be used on Unix if the zip file is intended for PKUNZIP under MSDOS. If the input files already contain CR LF, this option adds an extra CR. This ensure that <i>unzip -a</i> on Unix will get back an exact copy of the original file, to undo the effect of <i>zip -l.</i> </dd>
<dt><b>-ll</b></dt>
<dd>Translate the MSDOS end-of-line CR LF into Unix LF. This option should not be used on binary files. This option can be used on MSDOS if the zip file is intended for unzip under Unix. </dd>
<dt><b>-L</b></dt>
<dd>Display the <i>zip</i> license. </dd>
<dt><b>-m</b></dt>
<dd>Move the specified files into the <i>zip</i> archive; actually, this deletes the target directories/files after making the specified <i>zip</i> archive. If a directory becomes empty after removal of the files, the directory is also removed. No deletions are done until <i>zip</i> has created the archive without error. This is useful for conserving disk space, but is potentially dangerous so it is recommended to use it in combination with <b>-T</b> to test the archive before removing all input files. </dd>
<dt><b>-n suffixes</b></dt>
<dd>Do not attempt to compress files named with the given <i>suffixes.</i> Such files are simply stored (0% compression) in the output zip file, so that <i>zip</i> doesn&#8217;t waste its time trying to compress them. The suffixes are separated by either colons or semicolons. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -rn .Z:.zip:.tiff:.gif:.snd foo foo </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will copy everything from <i>foo</i> into <i>foo.zip</i>, but will store any files that end in <i>.Z</i>, <i>.zip</i>, <i>.tiff</i>, <i>.gif</i>, or <i>.snd</i> without trying to compress them (image and sound files often have their own specialized compression methods). By default, <i>zip</i> does not compress files with extensions in the list <i>.Z:.zip:.zoo:.arc:.lzh:.arj.</i> Such files are stored directly in the output archive. The environment variable ZIPOPT can be used to change the default options. For example under Unix with csh:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>setenv ZIPOPT &quot;-n .gif:.zip&quot; </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>To attempt compression on all files, use:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -n : foo </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>The maximum compression option <b>-9</b> also attempts compression on all files regardless of extension. </dd>
<dt></dt>
<dd>On Acorn RISC OS systems the suffixes are actually filetypes (3 hex digit format). By default, zip does not compress files with filetypes in the list DDC:D96:68E (i.e. Archives, CFS files and PackDir files). </dd>
<dt><b>-N</b></dt>
<dd>[Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile comments. They can be restored by using the -N option of unzip. If -c is used also, you are prompted for comments only for those files that do not have filenotes. </dd>
<dt><b>-o</b></dt>
<dd>Set the &quot;last modified&quot; time of the <i>zip</i> archive to the latest (oldest) &quot;last modified&quot; time found among the entries in the <i>zip</i> archive. This can be used without any other operations, if desired. For example: </dd>
<dt></dt>
<dd>zip -o foo </dd>
<dt></dt>
<dd>will change the last modified time of <i>foo.zip</i> to the latest time of the entries in <i>foo.zip</i>. </dd>
<dt></dt>
<dt><b>-P</b> <i>password</i></dt>
<dd></dd>
<dd>use <i>password</i> to encrypt zipfile entries (if any). <b>THIS IS INSECURE!</b> Many multi-user operating systems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the-shoulder peeking. Storing the plaintext password as part of a command line in an automated script is even worse. Whenever possible, use the non-echoing, interactive prompt to enter passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utilities.) </dd>
<dt><b>-q</b></dt>
<dd>Quiet mode; eliminate informational messages and comment prompts. (Useful, for example, in shell scripts and background tasks). </dd>
<dt><b>-Qn</b></dt>
<dd>[QDOS] store information about the file in the file header with n defined as
<dl compact="compact">
<dt></dt>
<dd>bit 0: Don&#8217;t add headers for any file </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 1: Add headers for all files </dd>
</dl>
<dl compact="compact">
<dt></dt>
<dd>bit 2: Don&#8217;t wait for interactive key press on exit </dd>
</dl>
</dd>
<dt><b>-r</b></dt>
<dd>Travel the directory structure recursively; for example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo foo </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>In this case, all the files and directories in <i>foo</i> are saved in a <i>zip</i> archive named <i>foo.zip</i>, including files with names starting with &quot;.&quot;, since the recursion does not use the shell&#8217;s file-name substitution mechanism. If you wish to include only a specific subset of the files in directory <i>foo</i> and its subdirectories, use the <b>-i</b> option to specify the pattern of files to be included. You should not use <b>-r</b> with the name &quot;.*&quot;, since that matches &quot;..&quot; which will attempt to zip up the parent directory (probably not what was intended). </dd>
<dt><b>-R</b></dt>
<dd>Travel the directory structure recursively starting at the current directory; for example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -R foo &#8216;*.c&#8217; </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>In this case, all the files matching *.c in the tree starting at the current directory are stored into a <i>zip</i> archive named <i>foo.zip</i>. Note for PKZIP users: the equivalent command is
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>pkzip -rP foo *.c </dd>
</dl>
</dd>
</dl>
</dd>
<dt><b>-S</b></dt>
<dd>[MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
<dl compact="compact">
<dt></dt>
<dd>[MacOS] Includes finder invisible files, which are ignored otherwise. </dd>
</dl>
</dd>
<dt><b>-t mmddyyyy</b></dt>
<dd>Do not operate on files modified prior to the specified date, where <i>mm</i> is the month (0-12), <i>dd</i> is the day of the month (1-31), and <i>yyyy</i> is the year. The <i>ISO 8601</i> date format <i>yyyy-mm-dd</i> is also accepted. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -rt 12071991 infamy foo
<p>zip -rt 1991-12-07 infamy foo </p>
</dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will add all the files in <i>foo</i> and its subdirectories that were last modified on or after 7 December 1991, to the <i>zip</i> archive <i>infamy.zip</i>. </dd>
<dt><b>-tt mmddyyyy</b></dt>
<dd>Do not operate on files modified after or at the specified date, where <i>mm</i> is the month (0-12), <i>dd</i> is the day of the month (1-31), and <i>yyyy</i> is the year. The <i>ISO 8601</i> date format <i>yyyy-mm-dd</i> is also accepted. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -rtt 11301995 infamy foo
<p>zip -rtt 1995-11-30 infamy foo </p>
</dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will add all the files in <i>foo</i> and its subdirectories that were last modified before the 30 November 1995, to the <i>zip</i> archive <i>infamy.zip</i>. </dd>
<dt><b>-T</b></dt>
<dd>Test the integrity of the new zip file. If the check fails, the old zip file is unchanged and (with the <b>-m</b> option) no input files are removed. </dd>
<dt><b>-u</b></dt>
<dd>Replace (update) an existing entry in the <i>zip</i> archive only if it has been modified more recently than the version already in the <i>zip</i> archive. For example:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -u stuff * </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>will add any new files in the current directory, and update any files which have been modified since the <i>zip</i> archive <i>stuff.zip</i> was last created/modified (note that <i>zip</i> will not try to pack <i>stuff.zip</i> into itself when you do this). </dd>
<dt></dt>
<dd>Note that the <b>-u</b> option with no arguments acts like the <b>-f</b> (freshen) option. </dd>
<dt><b>-v</b></dt>
<dd>Verbose mode or print diagnostic version info. </dd>
<dt></dt>
<dd>Normally, when applied to real operations, this option enables the display of a progress indicator during compression and requests verbose diagnostic info about zipfile structure oddities. </dd>
<dt></dt>
<dd>When <b>-v</b> is the only command line argument, and stdout is not redirected to a file, a diagnostic screen is printed. In addition to the help screen header with program name, version, and release date, some pointers to the Info-ZIP home and distribution sites are given. Then, it shows information about the target environment (compiler type and version, OS version, compilation date and the enabled optional features used to create the <i>zip</i> executable. </dd>
<dt><b>-V</b></dt>
<dd>[VMS] Save VMS file attributes. <i>zip</i> archives created with this option will generally not be usable on other systems. </dd>
<dt><b>-w</b></dt>
<dd>[VMS] Append the version number of the files to the name, including multiple versions of files. (default: use only the most recent version of a specified file). </dd>
<dt><b>-x files</b></dt>
<dd>Explicitly exclude the specified files, as in:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo foo -x \*.o </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>which will include the contents of <i>foo</i> in <i>foo.zip</i> while excluding all the files that end in <i></i>.o<i>.</i> The backslash avoids the shell filename substitution, so that the name matching is performed by <i>zip</i> at all directory levels. </dd>
<dt></dt>
<dd>Also possible:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo foo <a href="mailto:-x@exclude.lst">-x@exclude.lst</a></dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd>which will include the contents of <i>foo</i> in <i>foo.zip</i> while excluding all the files that match the patterns in the file exclude.lst. </dd>
<dt><b>-X</b></dt>
<dd>Do not save extra file attributes (Extended Attributes on OS/2, uid/gid and file times on Unix). </dd>
<dt><b>-y</b></dt>
<dd>Store symbolic links as such in the <i>zip</i> archive, instead of compressing and storing the file referred to by the link (UNIX only). </dd>
<dt><b>-z</b></dt>
<dd>Prompt for a multi-line comment for the entire <i>zip</i> archive. The comment is ended by a line containing just a period, or an end of file condition (^D on UNIX, ^Z on MSDOS, OS/2, and VAX/VMS). The comment can be taken from a file:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -z foo &lt; foowhat </dd>
</dl>
</dd>
</dl>
</dd>
<dt><b>-#</b></dt>
<dd>Regulate the speed of compression using the specified digit <i>#</i>, where <b>-0</b> indicates no compression (store all files), <b>-1</b> indicates the fastest compression method (less compression) and <b>-9</b> indicates the slowest compression method (optimal compression, ignores the suffix list). The default compression level is <b>-6.</b> </dd>
<dt><b>-!</b></dt>
<dd>[WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security. </dd>
<dt><b>-@</b></dt>
<dd>Take the list of input files from standard input. Only one filename per line. </dd>
<dt><b>-$</b></dt>
<dd>[MSDOS, OS/2, WIN32] Include the volume label for the the drive holding the first file to be compressed. If you want to include only the volume label or to force a specific drive, use the drive name as first file name, as in:
<dl compact="compact">
<dt></dt>
<dd>
<dl compact="compact">
<dt></dt>
<dd>zip -$ foo a: c:bar </dd>
</dl>
</dd>
</dl>
</dd>
<dt></dt>
<dd></dd>
</dl>
<p><a name="lbAF"></a><br />
<h4>EXAMPLES</h4>
<p> The simplest example:
<dl compact="compact">
<dt></dt>
<dd>zip stuff * </dd>
</dl>
<p>creates the archive <i>stuff.zip</i> (assuming it does not exist) and puts all the files in the current directory in it, in compressed form (the <i>.zip</i> suffix is added automatically, unless that archive name given contains a dot already; this allows the explicit specification of other suffixes). </p>
<p>Because of the way the shell does filename substitution, files starting with &quot;.&quot; are not included; to include these as well: </p>
<dl compact="compact">
<dt></dt>
<dd>zip stuff .* * </dd>
</dl>
<p>Even this will not include any subdirectories from the current directory. </p>
<p>To zip up an entire directory, the command: </p>
<dl compact="compact">
<dt></dt>
<dd>zip -r foo foo </dd>
</dl>
<p>creates the archive <i>foo.zip</i>, containing all the files and directories in the directory <i>foo</i> that is contained within the current directory. </p>
<p>You may want to make a <i>zip</i> archive that contains the files in <i>foo</i>, without recording the directory name, <i>foo</i>. You can use the <b>-j</b> option to leave off the paths, as in: </p>
<dl compact="compact">
<dt></dt>
<dd>zip -j foo foo/* </dd>
</dl>
<p>If you are short on disk space, you might not have enough room to hold both the original directory and the corresponding compressed <i>zip</i> archive. In this case, you can create the archive in steps using the <b>-m</b> option. If <i>foo</i> contains the subdirectories <i>tom</i>, <i>dick</i>, and <i>harry</i>, you can: </p>
<dl compact="compact">
<dt></dt>
<dd>zip -rm foo foo/tom      <br />zip -rm foo foo/dick       <br />zip -rm foo foo/harry </dd>
</dl>
<p>where the first command creates <i>foo.zip</i>, and the next two add to it. At the completion of each <i>zip</i> command, the last created archive is deleted, making room for the next <i>zip</i> command to function. <a name="lbAG"></a></p>
<h4>PATTERN MATCHING</h4>
<p> This section applies only to UNIX. Watch this space for details on MSDOS and VMS operation.
<p>The UNIX shells (<i><a href="http://linux.about.com/library/cmd/blcmdl1_sh.htm">sh</a></i>(1) and <i><a href="http://linux.about.com/library/cmd/blcmdl1_csh.htm">csh</a></i>(1)) do filename substitution on command arguments. The special characters are: </p>
<dl compact="compact">
<dt><b>?</b></dt>
<dd>match any single character </dd>
<dt><b>*</b></dt>
<dd>match any number of characters (including none) </dd>
<dt><b>[]</b></dt>
<dd>match any character in the range indicated within the brackets (example: [a-f], [0-9]). </dd>
</dl>
<p>When these characters are encountered (without being escaped with a backslash or quotes), the shell will look for files relative to the current path that match the pattern, and replace the argument with a list of the names that matched. </p>
<p>The <i>zip</i> program can do the same matching on names that are in the <i>zip</i> archive being modified or, in the case of the <b>-x</b> (exclude) or <b>-i</b> (include) options, on the list of files to be operated on, by using backslashes or quotes to tell the shell not to do the name expansion. In general, when <i>zip</i> encounters a name in the list of files to do, it first looks for the name in the file system. If it finds it, it then adds it to the list of files to do. If it does not find it, it looks for the name in the <i>zip</i> archive being modified (if it exists), using the pattern matching characters described above, if present. For each match, it will add that name to the list of files to be processed, unless this name matches one given with the <b>-x</b> option, or does not match any name given with the <b>-i</b> option. </p>
<p>The pattern matching includes the path, and so patterns like \*.o match names that end in &quot;.o&quot;, no matter what the path prefix is. Note that the backslash must precede every special character (i.e. ?*[]), or the entire argument must be enclosed in double quotes (&quot;&quot;). </p>
<p>In general, use backslash to make <i>zip</i> do the pattern matching with the <b>-f</b> (freshen) and <b>-d</b> (delete) options, and sometimes after the <b>-x</b> (exclude) option when used with an appropriate operation (add, <b>-u</b>, <b>-f</b>, or <b>-d</b>). </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-command-zip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix rmdir command (remove &#8211; delete)</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-rmdir-command-remove-delete/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-rmdir-command-remove-delete/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 16:21:46 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-rmdir-command-remove-delete/</guid>
		<description><![CDATA[&#160; Source: http://www.computerhope.com/unix/urmdir.htm &#160; About rmdir Deletes a directory. Syntax rmdir [OPTION]&#8230; DIRECTORY&#8230; &#8211;ignore-fail-on-non-empty ignore each failure that is solely because a directory is non-empty. -p, &#8211;parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c&#8217; is similar to `rmdir a/b/c a/b a&#8217;. -v, &#8211;verbose output a diagnostic for every directory processed. &#8211;version output version [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a title="http://www.computerhope.com/unix/urmdir.htm" href="http://www.computerhope.com/unix/urmdir.htm" target="_blank">Source: http://www.computerhope.com/unix/urmdir.htm</a></p>
<p>&#160;</p>
<p>About rmdir</p>
<p>Deletes a directory.</p>
<p><a name="02"></a>Syntax</p>
<p>rmdir [OPTION]&#8230; DIRECTORY&#8230;</p>
<p>&#8211;ignore-fail-on-non-empty   <br />ignore each failure that is solely because a directory is non-empty.</p>
<p>-p, &#8211;parents   <br />Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c&#8217; is similar to `rmdir a/b/c a/b a&#8217;.</p>
<p>-v, &#8211;verbose   <br />output a diagnostic for every directory processed.</p>
<p>&#8211;version   <br />output version information and exit.</p>
<p><a name="03"></a>Examples</p>
<p><b>rmdir mydir</b> &#8211; removes the directory mydir </p>
<p><b>rm -r directory</b> &#8211; would remove a directory, even if files existed in that directory.</p>
<p><a name="04"></a>Related commands</p>
<p><a href="http://blog.server.ruservers.com/2009/02/linux-unix-rm-command-remove-delete/">rm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-rmdir-command-remove-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix rm command (remove &#8211; delete)</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-rm-command-remove-delete/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-rm-command-remove-delete/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 16:17:54 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-rm-command-remove-delete/</guid>
		<description><![CDATA[&#160; Source: http://www.computerhope.com/unix/urm.htm &#160; About rm Deletes a file without confirmation (by default). Syntax rm [-f] [-i] [-R] [-r] [filenames &#124; directory] -f Remove all files (whether write-protected or not) in a directory without prompting the user. In a write-protected directory, however, files are never removed (whatever their permissions are), but no messages are displayed. [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://www.computerhope.com/unix/urm.htm" href="http://www.computerhope.com/unix/urm.htm" target="_blank">http://www.computerhope.com/unix/urm.htm</a></p>
<p>&#160;</p>
<p>About rm</p>
<p>Deletes a file without confirmation (by default).</p>
<p><a name="02"></a>Syntax</p>
<p><i>rm [-f] [-i] [-R] [-r] [filenames | directory]</i></p>
<p>-f    <br />Remove all files (whether write-protected or not) in a directory without prompting the user. In a write-protected directory, however, files are never removed (whatever their permissions are), but no messages are displayed. If the removal of a write-protected directory is attempted, this option will not suppress an error message.</p>
<p>-i    <br />Interactive. With this option, rm prompts for confirmation before removing any files. It over- rides the -f option and remains in effect even if the standard input is not a terminal.</p>
<p>-R    <br />Same as -r option.</p>
<p>-r    <br />Recursively remove directories and subdirectories in the argument list. The directory will be emptied of files and removed. The user is normally prompted for removal of any write-protected files which the directory contains. The write-protected files are removed without prompting, however, if the -f option is used, or if the standard input is not a terminal and the -i option is not used.&#160; Symbolic links that are encountered with this option will not be traversed.&#160; If the removal of a non-empty, write-protected directory is attempted, the utility will always fail (even if the -f option is used), resulting in an error message.</p>
<p>filenames    <br />A path of a filename to be removed.</p>
<p><a name="03"></a>Examples</p>
<p><b>rm myfile.txt</b></p>
<p>Remove the file myfile.txt without prompting the user. </p>
<p><b>rm -r directory</b></p>
<p>Remove a directory, even if files existed in that directory.&#160;&#160; </p>
<p>Note that if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using <a href="http://blog.server.ruservers.com/2009/02/linux-unix-shred-command/">shred</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-rm-command-remove-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux / Unix shred command</title>
		<link>http://blog.server.ruservers.com/2009/02/linux-unix-shred-command/</link>
		<comments>http://blog.server.ruservers.com/2009/02/linux-unix-shred-command/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 16:14:56 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/02/linux-unix-shred-command/</guid>
		<description><![CDATA[&#160; Source: http://www.computerhope.com/unix/shred.htm &#160; About shred Delete a file securely, first overwriting it to hide its contents. Syntax shred [OPTIONS] FILE [...] -f, &#8211;force Change permissions to allow writing if necessary. -n, &#8211;iterations=N Overwrite N times instead of the default (25) -s, &#8211;size=N shred this many bytes (suffixes like K, M, G accepted) -u, &#8211;remove [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://www.computerhope.com/unix/shred.htm" href="http://www.computerhope.com/unix/shred.htm" target="_blank">http://www.computerhope.com/unix/shred.htm</a></p>
<p>&#160;</p>
<p>About shred</p>
<p>Delete a file securely, first overwriting it to hide its contents.</p>
<p><a name="02"></a>Syntax</p>
<p>shred [OPTIONS] FILE [...]</p>
<p>-f, &#8211;force   <br />Change permissions to allow writing if necessary.</p>
<p>-n, &#8211;iterations=N   <br />Overwrite N times instead of the default (25)</p>
<p>-s, &#8211;size=N   <br />shred this many bytes (suffixes like K, M, G accepted)</p>
<p>-u, &#8211;remove   <br />truncate and remove file after overwriting</p>
<p>-v, &#8211;verbose   <br />show progress</p>
<p>-x, &#8211;exact   <br />do not round file sizes up to the next full block; this is the default for non-regular files</p>
<p>-z, &#8211;zero   <br />add a final overwrite with zeros to hide shredding</p>
<p>-   <br />shred standard output</p>
<p>&#8211;help   <br />display this help and exit</p>
<p>&#8211;version   <br />output version information and exit</p>
<p><a name="03"></a>Examples</p>
<p><b>shred myfile.txt</b></p>
<p>Permanently deleted and makes the file myfile.txt unrecoverable (unless stored elsewhere or on a backup).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/02/linux-unix-shred-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Install the Apache Web Server</title>
		<link>http://blog.server.ruservers.com/2009/01/how-to-install-the-apache-web-server/</link>
		<comments>http://blog.server.ruservers.com/2009/01/how-to-install-the-apache-web-server/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 18:11:59 +0000</pubDate>
		<dc:creator>Ru Servers</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://blog.server.ruservers.com/2009/01/how-to-install-the-apache-web-server/</guid>
		<description><![CDATA[&#160; Source: http://webdesign.about.com/cs/apache/a/aainstallapache.htm &#160; Before You Begin Apache is one of the most popular Web servers on the Web right now, and part of its charm is that it&#8217;s free. It also has a lot of features that make it very extensible and useful for many different types of Web sites. It is a server [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Source: <a title="http://webdesign.about.com/cs/apache/a/aainstallapache.htm" href="http://webdesign.about.com/cs/apache/a/aainstallapache.htm" target="_blank">http://webdesign.about.com/cs/apache/a/aainstallapache.htm</a></p>
<p>&#160;</p>
<h5>Before You Begin</h5>
<p>Apache is one of the most popular Web servers on the Web right now, and part of its charm is that it&#8217;s free. It also has a lot of features that make it very extensible and useful for many different types of Web sites. It is a server that is used for personal Web pages up to enterprise level sites. </p>
<p>This article will discuss how to install Apache on a Linux system. Before we start you should be at least comfortable working in Linux &#8211; changing directories, using tar and gunzip, and compiling with make (I&#8217;ll discuss where to get binaries if you don&#8217;t want to mess with compiling your own). You should also have access to the root account on the server machine. </p>
<h5>Download Apache</h5>
<p>I recommend downloading the latest stable release. At the time of this writing, that was Apache 2.0. The best place to get Apache is from the <a href="http://httpd.apache.org/download.cgi">Apache HTTP Server download site</a>. Download the sources appropriate to your system. <a href="http://mirrors.midco.net/pub/apache.org/httpd/binaries/">Binary releases</a> are available as well. </p>
<h5>Extract the Files</h5>
<p>Once you&#8217;ve downloaded the files you need to uncompress them and untarring:   <br />&#160; gunzip -d httpd-2_0_NN.tar.gz    <br />&#160; tar xvf httpd-2_0_NN.tar    <br />This creates a new directory under the current directory with the source files. </p>
<h5>Configuring</h5>
<p>Once you&#8217;ve got the files, you need to tell your machine where to find everything by configuring the source files. The easiest way is to accept all the defaults and just type:   <br />&#160; ./configure </p>
<p>Of course, most people don&#8217;t want to accept just the default choices. The most important option is the prefix= option. This specifies the directory where the Apache files will be installed. You can also set specific environment variables and modules. Some of the <a href="http://httpd.apache.org/docs-2.0/mod/">modules</a> I like to have installed are: </p>
<ul>
<li>mod_alias &#8211; to map different parts of the URL tree </li>
<li>mod_include &#8211; to parse Server Side Includes </li>
<li>mod_mime &#8211; to associate file extensions with its MIME-type </li>
<li>mod_rewrite &#8211; to rewrite URLs on the fly </li>
<li>mod_speling (sic) &#8211; to help your readers who might misspell URLs </li>
<li>mod_ssl &#8211; to allow for strong cryptography using SSL </li>
<li>mod_userdir &#8211; to allow system users to have their own Web page directories</li>
</ul>
<p>Please keep in mind that these aren&#8217;t all the modules I might install on a given system. Read the <a href="http://httpd.apache.org/docs-2.0/mod/">details about the modules</a> to determine which ones you need. </p>
<h5>Build</h5>
<p>As with any source installation, you&#8217;ll then need to build the installation:   <br />&#160; make    <br />&#160; make install </p>
<h5>Customize</h5>
<p>Assuming that there were no problems, you are ready to customize your Apache configuration. This really just amounts to editing the httpd.conf file. This file is located in the PREFIX/conf directory. I generally edit it with <a href="http://webdesign.about.com/cs/vithetexteditor/index.htm">vi</a>:    <br />&#160; vi PREFIX/conf/httpd.conf    <br />Note: you&#8217;ll need to be root to edit this file. </p>
<p>Follow the instructions in this file to edit your configuration the way you want it. More help is available on the <a href="http://httpd.apache.org/docs-2.0/mod/quickreference.html">Apache Web site</a>. </p>
<h5>Test Your Server</h5>
<p>Open a Web browser on the same machine and type http://localhost/ in the address box. You should see a page similar to the one in the partial screen shot above. Specifically, it will say in big letters &quot;Seeing this instead of the website you expected?&quot; This is good news, as it means your server installed correctly. </p>
<h5>Start Editing/Uploading Pages</h5>
<p>Once your server is up and running you can start posting pages. Have fun building your Web site. </p>
<h6>Web Design Path</h6>
<p><a href="http://webdesign.about.com/library/bl_proprogrammers.htm">Professional Web Developers</a></p>
<h6>Suggested Reading</h6>
<p><a href="http://webdesign.about.com/library/weekly/aa092099.htm">How are You Being Served?</a>    <br /><a href="http://webdesign.about.com/library/weekly/aa092501a.htm">Time to Switch from IIS</a>    <br /><a href="http://webdesign.about.com/library/weekly/aa051301a.htm">Become a Hosting Provider</a></p>
<h6>More Apache Help</h6>
<p><a href="http://webdesign.about.com/cs/apache/a/aainstapachewin.htm">How to Install Apache on Windows</a>&#160; <br /><a href="http://webdesign.about.com/cs/apache/">More Apache Resources</a>    <br /><a href="http://webdesign.about.com/cs/webservers/">Other Web Servers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.server.ruservers.com/2009/01/how-to-install-the-apache-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
