Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160966004
D25149.id72793.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25149.id72793.diff
View Options
Index: head/usr.bin/uniq/uniq.1
===================================================================
--- head/usr.bin/uniq/uniq.1
+++ head/usr.bin/uniq/uniq.1
@@ -31,7 +31,7 @@
.\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd December 15, 2019
+.Dd June 7, 2020
.Dt UNIQ 1
.Os
.Sh NAME
@@ -147,6 +147,56 @@
.Xr environ 7 .
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Assuming a file named cities.txt with the following content:
+.Bd -literal -offset indent
+Madrid
+Lisbon
+Madrid
+.Ed
+.Pp
+The following command reports three different lines since identical elements
+are not adjacent:
+.Bd -literal -offset indent
+$ uniq -u cities.txt
+Madrid
+Lisbon
+Madrid
+.Ed
+.Pp
+Sort the file and count the number of identical lines:
+.Bd -literal -offset indent
+$ sort cities.txt | uniq -c
+ 1 Lisbon
+ 2 Madrid
+.Ed
+.Pp
+Assuming the following content for the file cities.txt:
+.Bd -literal -offset indent
+madrid
+Madrid
+Lisbon
+.Ed
+.Pp
+Show repeated lines ignoring case sensitiveness:
+.Bd -literal -offset indent
+$ uniq -d -i cities.txt
+madrid
+.Ed
+.Pp
+Same as above but showing the whole group of repeated lines:
+.Bd -literal -offset indent
+$ uniq -D -i cities.txt
+madrid
+Madrid
+.Ed
+.Pp
+Report the number of identical lines ignoring the first character of every line:
+.Bd -literal -offset indent
+$ uniq -s 1 -c cities.txt
+ 2 madrid
+ 1 Lisbon
+.Ed
.Sh COMPATIBILITY
The historic
.Cm \&\(pl Ns Ar number
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 30, 11:46 AM (15 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34500542
Default Alt Text
D25149.id72793.diff (1 KB)
Attached To
Mode
D25149: uniq(1): Add EXAMPLES section
Attached
Detach File
Event Timeline
Log In to Comment