参考: https://superuser.com/questions/544797/vim-delete-all-lines-but-unique
The Sort-Object cmdlet in PowerShell supports a -Unique switch that does the same thing as uniq:
Get-Content file.txt | Sort-Object -unique
Of course, owing to presence of aliases in PowerShell, you can also write:
type file.txt | sort -unique
没有评论:
发表评论