Vidyalelo
Computer Science · Q33

UNIX

Engineering and GATE · Computer Science · question 33

Q33

Which of the following commands is used to obtain a list of all files by modification time?

A.
ls -l
B.
ls -t
Answer
C.
ls -i
D.
ls -R
E.
None of the above

Answer: Option B

Solution

Answer: Option B
Solution:
In Unix, the ls command is used to list directory contents. The -t option with ls is used to sort files by modification time, showing the most recently modified files first.
So, ls -t is the command used to obtain a list of all files sorted by modification time.