Multiple choice general knowledge science & technology

Suppose you have a file test.txt Contain 9 columns which of the following you will use to extract 9 column from the file test.txt and store in a file Result.txt?

  1. awk '{print $9}' test.txt > Result.txt

  2. awk '{print $9}' Result.txt > test.txt

  3. awk '{print $9}' Test.txt > result.txt

  4. awk '{print $9}' result.txt > Test.txt

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The awk command '{print $9}' extracts the 9th column from each line of test.txt, and the '>' operator redirects the output to Result.txt. This is the correct syntax and file order. The other options either swap the file names (which would overwrite test.txt) or have incorrect case sensitivity in filenames (Unix is case-sensitive).