nerdexam
CompTIA

220-1102 · Question #416

Which of the following ls command options is used to display hidden files and directories?

The correct answer is A. -a. To display hidden files and directories in Linux and Unix-like systems, the ls -a command option is used.

Operating Systems

Question

Which of the following ls command options is used to display hidden files and directories?

Options

  • A-a
  • B-s
  • C-lh
  • D-t

How the community answered

(31 responses)
  • A
    90% (28)
  • C
    6% (2)
  • D
    3% (1)

Why each option

To display hidden files and directories in Linux and Unix-like systems, the `ls -a` command option is used.

A-aCorrect

In Linux and Unix-like operating systems, files and directories that begin with a dot (.) are considered hidden and are not shown by default with the `ls` command. The `ls -a` option (or `--all`) specifically instructs the `ls` command to list all entries, including these hidden dotfiles and dotdirectories.

B-s

The `ls -s` option displays the size of each file in blocks.

C-lh

The `ls -l` option displays files in a long listing format, and `h` is for human-readable sizes, but neither alone nor together shows hidden files.

D-t

The `ls -t` option sorts the output by modification time, with the newest files appearing first.

Concept tested: Linux/Unix ls command options

Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/listing-files-and-directories_configuring-basic-system-settings

Topics

#ls command#Command Line Interface (CLI)#Hidden files#Linux commands

Community Discussion

No community discussion yet for this question.

Full 220-1102 Practice