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?
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.