Search
Write a publication
Pull to refresh
1
0
Send message

Когда повторяющиеся данные не идут друг за другом, сначала нужно отсортировать их, а затем удалить дубликаты.

/tmp ❯ cat test.txt
test 1
test 2
test 3
test 3
test 4
test 1

/tmp ❯ cat test.txt | uniq
test 1
test 2
test 3
test 4
test 1

/tmp ❯ cat test.txt | sort | uniq
test 1
test 2
test 3
test 4

/tmp ❯ cat test.txt | sort -u
test 1
test 2
test 3
test 4

Information

Rating
Does not participate
Registered
Activity