Your GNU+Linux system came with GNU's versions of the unix sort(1), tr(1), and cut(1) commands. (They've got (1) on their names because they are in chapter 1 of the local manual, "user commands.") Sort(1) does what you expect. Tr(1) (translate) is best known for implementing simple substitution ciphers, but I'm going to use its -s (squeeze) option to make sure there is only one space between each of the columns in your file. Cut(1) picks columns out of a file. It can pick them by character position or by whole words.
Each of these commands is a "filter." If you don't tell them what file(s) to read, they expect to read from a pipe. They blurt their output to "the standard output stream" which might be another pipe, your terminal, or a file. That makes them easy to chain together. Arranging that chain is bash(1)'s job. Let's say your file is textfile.
tr -s ' ' < textfile | sort -n -k2 | cut -d' ' -f3 > sortedfile
ought to do it. We squeeze the extra spaces out, sort lines numerically, keying on the second word, and cut the third column out of the result. Notice the spaces in quotes. The quotes prevent bash(1) from eating them. So tr(1) is squeezing spaces, and cut(1) is using spaces to delimit fields. The spaces surrounding the I/O redirections <, >, and | are optional, but they make your scripts easier to read. In the cut(1) command, there is no space between the -d and whatever the delimiter character is. Both sort(1) and cut(1) start counting fields at one. Some other commands start counting at zero.
We could do this in a Perl or awk(1) "one liner" but that would be harder.
I am new to linux and have a text file that looks like this:
123 234234 one
234 456 two
694 2349 three
Each of the lines has three specific areas: the first three digits, then a a number with a maximum of six digits, then a word. I am trying to sort this column by the second area, but only display the third column. I know that I will have to use the sort command but I cannot figure out how to get it to work.
Thanks for any help, I'm new!