Multiple choice server

Which Unix command will give the contents of the root directory?

  1. ls

  2. ls -l

  3. ls -al

  4. ls /

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The 'ls /' command specifically lists the contents of the root directory (/). 'ls' alone lists the current directory, 'ls -l' adds detailed formatting, and 'ls -al' shows all files including hidden ones in the current directory - none of these specify the root directory. The path argument '/' is essential.