I'd like to determine the frequency that each number occurs within a text file. I know how to do this for a single number, but not for a set or list of numbers. Here's what I have
grep -o 01 file.txt | wc -l
Also, it's important that the numbers are two digits instead of 1, meaning that single digit numbers should begin with a 0.
I wonder how you are going to learn something by asking for solutions here. Without even trying to find a solution yourself you will learn next to nothing from such an endeavour.
First, your "single number solution" works only with one fixed number, which you have to provide beforehand. To find the solutions of arbitrary numbers you will first have to find out which numbers are there, before counting them one by one.
Second, i suggest you read the man page of grep again. The more commands you use to achieve a certain task the more (processor) time it takes. Try to eliminate commands in the pipeline you use.
Learning a solution to a problem is also learning. It's not that important, I may or may not do it on my own. Thanks for redirecting me away from here.