Understanding The Use of ‘uniq’ Command to Show File Details

A Linux Hosting India administrator use a number highly useful commands to execute the file listing processes. Most of the hosting professionals use ‘uniq’ command to perform specific file functions. Find below the syntax of this command.

  • uniq: Used to print the file by removing duplicate adjacent lines.
  • Syntax: uniq filename

    Ex: $ uniq file

  • uniq –u filename –unique : Prints the only unique lines
  • uniq –d filename –repeated : Prints the only duplicate lines
  • uniq –c filename –count : Prints the number of times each line occurred

Rate this post:


1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...