TestOut Linux Pro Practice Test

Question: 1 / 400

What command would you use to view all hidden files in a directory?

ls

ls -a

To view all hidden files in a directory, the command you would use is "ls -a." In Unix-like operating systems, hidden files are typically those that begin with a dot (.), and by default, the standard "ls" command does not display these files. The "-a" option stands for "all," which instructs the command to include all files in the output, including those that are hidden. This allows users to see a complete list of files and directories in their current working directory, enabling management of all available files.

The other options do not fulfill this requirement. The standard "ls" command only shows visible files. The "ls -l" command provides a detailed list format, showing file permissions, number of links, owner, group, size, and modification date, but it still does not include hidden files without the "-a" option. The "ls -h" command produces a human-readable format for file sizes but, like the previous options, does not display hidden files on its own. Thus, using "ls -a" is the correct approach to view all files, including those that are hidden.

Get further explanation with Examzify DeepDiveBeta

ls -l

ls -h

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy