*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> uniq (1)              
Title
Content
Arch
Section
 

uniq(1)

Contents


NAME    [Toc]    [Back]

       uniq - Removes or lists repeated lines in a file

SYNOPSIS    [Toc]    [Back]

   Current Syntax
       uniq  [-cdu]  [-f  fields] [-s chars] [input-file [outputfile]]



   Obsolescent Syntax    [Toc]    [Back]
       uniq [-cdu] [-fields] [+chars] [input-file [output-file]]

       The uniq command reads from the specified input_file, compares
  adjacent  lines,  removes the second and succeeding
       occurrences of a line, and writes to standard output.

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       uniq:  XCU5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

OPTIONS    [Toc]    [Back]

       Precedes each output line with a count of  the  number  of
       times  each  line appears in the file.  This option supersedes
 the -d and  -u  options.   Displays  repeated  lines
       only.   Ignores the first fields fields on each input line
       when doing comparisons, where fields is a positive decimal
       integer.   A  field  is  the maximal string matched by the
       basic regular expression:

              [[:blank:]]*[^[:blank:]]*

              If the fields argument specifies more  fields  than
              appear  on an input line, a null string is used for
              comparisons.  Ignores the specified number of characters
  when doing comparisons.  The chars argument
              is a positive decimal integer.

              If specified with the -f option,  the  first  chars
              characters   after  the  first  fields  fields  are
              ignored.  If  the  chars  argument  specifies  more
              characters  than remain on an input line, uniq uses
              a null  string  for  comparison.   Displays  unique
              lines  only.   Equivalent  to -f fields.  (Obsolescent)
 Equivalent to -s chars.  (Obsolescent)

OPERANDS    [Toc]    [Back]

       A pathname for the input file.

              If this operand is omitted or specified as -,  then
              standard  input is read.  A pathname for the output
              file.

              If this operand is omitted, then standard output is
              written.



DESCRIPTION    [Toc]    [Back]

       The input_file and output_file arguments must be different
       files.  If the input_file operand is not specified, or  if
       it is -, uniq uses standard input.

       Repeated  lines  must be on consecutive lines to be found.
       You can arrange them with the sort command before processing.

EXAMPLES    [Toc]    [Back]

       To  delete  repeated  lines  in  the following file called
       fruit and save it to a file named  newfruit,  enter:  uniq
       fruit newfruit

       The file fruit contains the following lines:

       apples apples bananas cherries cherries peaches pears

       The file newfruit contains the following lines:

       apples bananas cherries peaches pears

EXIT STATUS    [Toc]    [Back]

       The following exit values are returned: Successful completion.
  An error occurred.

ENVIRONMENT VARIABLES    [Toc]    [Back]

       The following environment variables affect  the  execution
       of  uniq:  Provides a default value for the internationalization
 variables that are unset or null. If LANG is unset
       or  null,  the corresponding value from the default locale
       is used.  If any  of  the  internationalization  variables
       contain an invalid setting, the utility behaves as if none
       of the variables had been defined.  If set to a  non-empty
       string value, overrides the values of all the other internationalization
 variables.  Determines the locale for  the
       interpretation of sequences of bytes of text data as characters
 (for example, single-byte as opposed  to  multibyte
       characters  in  arguments).  Determines the locale for the
       format and contents  of  diagnostic  messages  written  to
       standard  error.  Determines the location of message catalogues
 for the processing of LC_MESSAGES.

SEE ALSO    [Toc]    [Back]

      
      
       Commands:  comm(1), sort(1)

       Standards:  standards(5)



                                                          uniq(1)
[ Back ]
 Similar pages
Name OS Title
uniq IRIX report repeated lines in a file
uniq HP-UX report repeated lines in a file
uniq OpenBSD report or filter out repeated lines in a file
uniq FreeBSD report or filter out repeated lines in a file
unifdef Tru64 Removes #ifdefed lines
paste Tru64 Joins corresponding lines of several files or subsequent lines in one file
paste HP-UX merge same lines of several files or subsequent lines of one file
paste IRIX merge same lines of several files or subsequent lines of one file
fdelproplist Tru64 removes Extended File Attributes from a file
delproplist Tru64 removes Extended File Attributes from a file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service