cmp man page on OpenIndiana

Man page or keyword search:  
man Server   20441 pages
apropos Keyword Search (all sections)
Output format
OpenIndiana logo
[printable version]

cmp(1)				 User Commands				cmp(1)

NAME
       cmp - compare two files

SYNOPSIS
   /usr/bin/cmp
       /usr/bin/cmp [options] file1 file2 [skip1] [skip2]

   ksh93
       cmp [options] file1 file2 [skip1] [skip2]

DESCRIPTION
       cmp  compares  two  files  file1 and file2. cmp writes no output if the
       files are the same. By default, if the files differ, the byte and  line
       number  at  which the first difference occurred are written to standard
       output. Bytes and lines are numbered beginning with 1.

       If skip1 or skip2 are specified, or the -i option is specified, initial
       bytes  of  the corresponding file are skipped before beginning the com‐
       pare. The skip values are in bytes or can have a suffix of k for	 kilo‐
       bytes or m for megabytes.

       If either file1 or files2 is -, cmp uses standard input starting at the
       current location.

OPTIONS
       The following options are supported:

       -c		       Set default skip values for the operands	 skip1
       --print-chars	       and skip2 to skip. The default value is 0.

       -i		       Set  default skip values for the operands skip1
       --ignore-inital-skip    and skip2 to skip. The default value is 0.

       -l		       Write the decimal byte number and the differing
       --verbose	       bytes (in octal) for each difference.

       -s		       Write  nothing for differing files. Return non-
       --quiet|silent	       zero exit status only.

       -man		       Print built-in  manual  page  in	 either	 plain
       --html		       text, HTML or nroff format.
       --nroff

       --help		       Print basic help information

       --version	       Print version information

OPERANDS
       The following operands are supported:

       file1	A  path	 name of the first file to be compared. If file1 is −,
		the standard input is used.

       file2	A path name of the second file to be compared. If file2 is  −,
		the standard input is used.

       If  both	 file1	and file2 refer to standard input or refer to the same
       FIFO special,  block  special  or  character  special  file,  an	 error
       results.

USAGE
       See  largefile(5)  for  the  description	 of  the  behavior of cmp when
       encountering files greater than or equal to 2 Gbyte (2^31 bytes).

EXAMPLES
       Example 1 Comparing Files Byte for Byte

       The following example does a byte for  byte  comparison	of  file1  and
       file2:

	 example% cmp file1 file2 0 1024

       It skips the first 1024 bytes in file2 before starting the comparison.

ENVIRONMENT VARIABLES
       See  environ(5) for descriptions of the following environment variables
       that affect the execution of cmp: LANG, LC_ALL, LC_CTYPE,  LC_MESSAGES,
       and NLSPATH.

EXIT STATUS
       The following error values are returned:

       0     The files are identical.

       1     The files are different. This includes the case where one file is
	     identical to the first part of the other.

       >1    An error occurred.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Availability		     │SUNWcs			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │CSI			     │Enabled			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Committed			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Standard		     │See standards(5).		   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       comm(1), diff(1), ksh93(1),  attributes(5),  environ(5),	 largefile(5),
       standards(5)

SunOS 5.11			  28 Nov 2009				cmp(1)
[top]

List of man pages available for OpenIndiana

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net