Multiple choice technology operating systems

What will the following command do? $ echo *

  1. This will not work

  2. Similar to ls command and displays all files in current dir

  3. will display the string " * "

  4. will display all the files in the previously ccessed directory

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

The shell expands the wildcard * to list all files and directories in the current directory before executing the command. Consequently, echo * displays these names separated by spaces, behaving similarly to ls. The other options are incorrect because the wildcard is resolved by the shell.