Question 60Asked in UGC NET Computer Science, August 2016 (Paper II & III, Selected Questions)

Consider the following operations to be performed in Unix: "The pipe sorts all files in the current directory modified in the month of "June" by order of…

Consider the following operations to be performed in Unix: "The pipe sorts all files in the current directory modified in the month of "June" by order of size and prints them to the terminal screen. The sort option skips ten fields then sorts the lines in numeric order." Which of the following Unix command will perform above set of operation?
  1. Als -l | grep "June" | sort +10n
  2. Bls -l | grep "June" | sort +10r
  3. Cls -l | grep -v "June" | sort +10n
  4. Dls -l | grep -n "June" | sort +10x
Show answerHide answer

Correct answer: (A) ls -l | grep "June" | sort +10n

Explanation

ls -l lists the files with details, grep "June" keeps the lines for files modified in June, and sort +10n skips ten fields and sorts the lines in numeric order. So the correct command is ls -l | grep "June" | sort +10n.

From UGC NET Computer Science PYQ, August 2016 (Paper II & III, Selected Questions)

This is question 60 of UGC NET Computer Science PYQ, August 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.