Home » mariadb on ubuntu » UNIX/LINUX Command – uniq

UNIX/LINUX Command – uniq

Last updated Apr 27, 2021

NAME

uniq—Remove duplicate lines from a sorted file

SYNOPSIS

uniq [-cdu] [-f skip-fields] [-s skip-chars] [-w check-chars] [-#skip-fields] [+#skip-chars] [–count] [–repeated] [–unique] [–skip-fields=skip-fields] [–skip-chars=skip-chars] [–check-chars=check-chars] [–help] [–version] [infile] [outfile]

DESCRIPTION

This manual page documents the GNU version of uniq. uniq prints the unique lines in a sorted file, discarding all but one of a run of matching lines. It can optionally show only lines that appear exactly once, or lines that appear more than once. uniq requires sorted input because it compares only consecutive lines.

If the output file is not specified, uniq writes to the standard output. If the input file is not specified, it reads from the standard input.

OPTIONS

Option  Description 
-u, –unique Only print unique lines
-d, –repeated Only print duplicate lines
-c, –count-number, -f, –skip-fields=number Print the number of times each line occurred along with the line In this option, number is an integer representing the number of fields to skip over before checking for uniqueness. The first number fields, along with any blanks found before number fields is reached, are skipped over and not counted. Fields are defined as a strings of nonspace, nontab characters that are separated from each other by spaces and tabs.
+number, -s, –skip-chars=number In this option, number is an integer representing the number of characters to skip over before checking for uniqueness. The first number characters, along with any blanks found before number characters is reached, are skipped over and not counted. If you use both the field and character skipping options, fields are skipped over first.
-w, –check-chars=number Specify the number of characters to compare in the lines, after skipping any specified fields and characters. Normally, the entire remainder of the lines are compared.
–help Print a usage message and exit with a non-zero status.
–version Print version information on standard output, then exit.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

UNIX/LINUX Command – uuencode

UNIX/LINUX Command – uuencode

NAME uuencode—Encode a binary fileuudecode—Decode a file created by uuencode SYNOPSIS uuencode [-m] [ file ] nameuudecode [-o outfile] [ file ]… DESCRIPTION uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other...

Follow Us

Our Communities

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

one × two =

Shares