`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Linux Command Line 11
wc, sort, uniq







Linux Command Line (33) wc, sort, uniq

I created a new directory, and added some new files, presidents-by-height.txt and an I have updated the grocerylist.txt file. You can find them at:

thefrugalcomputerguy.com

We first look at the "wc" command for wordcount and see how that counts the words, lines, and characters of a file.

The we look at how to sort the grocerylist.txt file with the "sort" command and filter out he duplicate items on that file.

We then start to look at the uniq command and see that to get the most out of the uniq command, we need to use the sorted output from the sort command

We then look at ways to run multiple commands on a single line and that we can separate them with a semicolon (;) for two separate commands or use the pipe symbol (|) to have the output of the one command pipe that output into the next command.

We pipe the output from the sort command into the uniq command and see that uniq is useful when you need to see what items were duplicated or what items were duplicated and how many times there were duplicated.

We then use the presents-by-height.txt file with the sort command to show how to sort that file by presidential order or by first name