How to use the uniq command in Linux?

  uniq is one of the commonly used commands in Linux. It is the only abbreviation of unique in English. This command is used to check and delete repeated rows and columns in text files. So how to use the uniq command in Linux? The following is a detailed introduction.

  The Linux uniq command is used to check and delete repeated rows and columns in a text file, and is generally used in combination with the sort command.

  uniq checks for repeated rows and columns in a text file.

  grammar:

  uniq [-cdu][-f<field>][-s<character position>][-w<character position>][--help][--version][input file][output file]

  parameter:

  -c or --count display next to each column the number of times the row is repeated

  -d or --repeated only show repeated rows and columns

  -f <fields> or --skip-fields=<fields> ignore comparison specified fields

  -s<character position> or --skip-chars=<character position> ignore the specified characters for comparison

  -u or --unique Only show the row and column once

  -w<character position> or --check-chars=<character position> specifies the character to compare

  --help display help

  --version display version information

  <input file> specifies the sorted text file. If not specified, data is read from the standard

  <output file> Specifies the output file. If this option is not specified, the content is displayed to the standard output device

おすすめ

転載: blog.csdn.net/oldboyedu1/article/details/131229825