Fill these in once
- Count the lines
wc -l list.txt - Show the lines in order
sort list.txtAdd -n to sort numbers by size or -r to reverse.
- Show each line once
sort -u list.txt - Count how often each line appears, most first
sort list.txt | uniq -c | sort -rn - Save the clean list to a new file
sort -u list.txt > unique.txt
- Count the lines
wc -l list.txt - Show the lines in order
sort list.txtAdd -n to sort numbers by size or -r to reverse.
- Show each line once
sort -u list.txt - Count how often each line appears, most first
sort list.txt | uniq -c | sort -rn - Save the clean list to a new file
sort -u list.txt > unique.txt
- Count the lines
(Get-Content list.txt).Count - Show the lines in order
Get-Content list.txt | Sort-ObjectAdd -Descending to reverse.
- Show each line once
Get-Content list.txt | Sort-Object -UniqueThis ignores capital letters, so Apple and apple count as the same line.
- Count how often each line appears, most first
Get-Content list.txt | Group-Object | Sort-Object Count -Descending | Select-Object Count, Name - Save the clean list to a new file
Get-Content list.txt | Sort-Object -Unique | Set-Content unique.txt