How Use Uniq Command in Linux?

How Use Uniq Command in Linux?
Contents

How does uniq work in Linux?

The uniq command in Linux is a command line utility that reports or filters out the repeated lines in a file. In simple words, uniq is the tool that helps to detect the adjacent duplicate lines and also deletes the duplicate lines.

What does the uniq command do in Unix?

uniq is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or STDIN, outputs the text with adjacent identical lines collapsed to one, unique line of text.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.