Linux - Sample Interview Question (Junior Level)

The file fruits.txt contains the following items

Banana
Apple
Orange
Grapes
Watermelon
Melon
Pear

How can you print the first 3 items sorted alphabetically? 

  1. split -1 fruits.txt ; cat xa? | head -3
  2. nl fruits.txt | sort | sed '/^ [^123]/d'
  3. nl fruits.txt | sort | head -3
  4. sort fruits.txt | nl | head -3
  5. None of the above
Tests in Linux for Juniors

Test Name Difficulty Time (minutes) No. of Questions
Linux Online Test for Juniors Linux Junior 60 30

More Specific Tests in Linux for Juniors

Test Name Difficulty Time (Minutes) No. of Questions
Linux-Basics Online Test for Juniors Linux - Basics Junior 20 10
Linux-I/O-redirection Online Test for Juniors Linux - I/O redirection Junior 20 10
Linux-Processes Online Test for Juniors Linux - Processes Junior 20 10
Linux-Files-and-file-system Online Test for Juniors Linux - Files and file system Junior 20 10
Linux-Network Online Test for Juniors Linux - Network Junior 20 10