Unix - Engineering

Q1:

Which command is used to extract specific columns from the file?

A cat

B cut

C grep

D paste

E None of the above

ANS:B - cut

We can extract specific columns from the file using 2 ways.

1. cut -f 1,2 -d ' ' filename.
2. awk '{print $1 " " $2}' filename.