nerdexam
LPI

010-150 · Question #1

What is the first character for file or directory names if they should not be displayed by commands such as ls unless specifically requested?

The correct answer is B. . (dot). In Linux and Unix-like systems, files and directories beginning with a dot are treated as hidden and are not shown by default with ls or similar commands.

Initial Client Consultation and Assessment

Question

What is the first character for file or directory names if they should not be displayed by commands such as ls unless specifically requested?

Options

  • A\ (backslash)
  • B. (dot)
  • C
    • (minus)
  • D_ (underscore)

How the community answered

(26 responses)
  • A
    15% (4)
  • B
    73% (19)
  • C
    4% (1)
  • D
    8% (2)

Why each option

In Linux and Unix-like systems, files and directories beginning with a dot are treated as hidden and are not shown by default with ls or similar commands.

A\ (backslash)

A backslash is an escape character in shell syntax and has no special meaning as a filename prefix for hiding files.

B. (dot)Correct

The dot (.) as the first character of a filename is the Unix/Linux convention for marking a file or directory as hidden. Commands like ls omit these entries by default, and you must use ls -a or ls -A to reveal them. This behavior is built into the shell and standard utilities across all POSIX-compliant systems.

C- (minus)

A leading hyphen-minus has no hiding effect - it can cause issues with some commands that interpret it as an option flag, but ls will still display such files.

D_ (underscore)

An underscore prefix is a common naming convention in some languages for private variables but has no effect on file visibility in the filesystem.

Concept tested: Linux hidden file and directory naming convention

Source: https://www.gnu.org/software/coreutils/manual/coreutils.html#ls-invocation

Topics

#hidden files#file naming conventions#dot prefix#Linux filesystem

Community Discussion

4
Lena V.Lena V.Jun 26, 2026

B is correct. In Linux and Unix systems, any file or directory whose name begins with a dot is treated as hidden and will not appear in ls output unless you use the -a or -la flag to show all files.

23
Grace U.Grace U.Jun 26, 2026

I remember staring at this exact question and second-guessing myself for a second before I thought of files like .bashrc sitting quietly in my home directory, and that dot clicked right into place, B all the way. If you have ever typed ls -a and suddenly seen a bunch of files that were hiding in plain sight, you already know this one in your bones.

4
Lena V.Lena V.Jun 28, 2026

The muscle memory from ls -a is real, but for the exam just lock in that the dot prefix is the Linux hiding convention, not a permission or attribute flag, so you can eliminate C and D fast and never lose time second-guessing.

0
Ola B.Ola B.Jun 25, 2026

I actually leaned toward A at first because backslash feels special in shell contexts, but then I spun up a quick terminal and tried naming a file with a dot prefix and ran ls, and sure enough it vanished from the output until I added the -a flag. That hands-on check reminded me that the dot convention for hidden files goes all the way back to early Unix, so B is the one to lock in.

2
Full 010-150 Practice