Multiple choice technology operating systems

How to list all files in the current directory?

  1. dir *

  2. dir .

  3. list all

  4. ls -a

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

'ls -a' lists all files in the current directory, including hidden files (those starting with a dot). 'dir' is a DOS/Windows command, not standard Unix. 'list all' is not a valid Unix command. The '-a' flag is specifically designed to show all files including hidden ones, which 'dir ' or 'dir *.' wouldn't do in Unix.