What will the following command do? echo *
-
It is similar to 'ls -a' command and displays all the hidden files in the current directory
-
displays all the files in the /etc directory
-
displays all the files in the root
-
It is similar to 'ls' command and displays all the files in the current directory
The echo * command expands the * wildcard to match all files and directories in the current directory and prints their names. This is similar to the ls command but displays output in a single line. Option A is incorrect because echo * does not show hidden files (those starting with .). Options B and C are wrong because * operates on the current directory, not /etc or root.
In the shell, * is a glob pattern that expands to all non-hidden filenames in the current directory before being passed to echo, so echo * prints the same file list you'd get from a plain ls (hidden dotfiles are excluded unless dotglob/-a behavior is enabled).