How Linux Hides Files with a Leading Period Character
Short answer
C On Linux, prefixing a filename with a period (.) makes it a hidden dotfile that standard listings like ls omit.
Question
Key Takeaways
The tested fact is that a leading period makes a file hidden on Linux; the trap is assuming any special or non-alphanumeric character hides a file, when only the dot prefix has that meaning.
On Linux, files and directories whose names begin with a period (.) are treated as hidden and are omitted from standard directory listings such as ls. This question confirms that the leading dot character is the mechanism, and that options like the tilde, underscore, or exclamation mark have no hiding property.
Common mistake: Learners sometimes pick Underscore (_) or Tilde (~) because those characters begin shell temporary or backup files, but those are naming conventions with no hiding effect — only the period prefix causes ls and file managers to treat a file as hidden.
Expert Analysis
Why the Answer Is Correct
In Linux, any file or directory whose name starts with a period is classified as a dotfile and is not shown by default by tools like ls, nor by most graphical file managers. This is a convention built into the standard listing utilities, not an encryption or permission feature — the data is fully readable to anyone who knows the exact filename or runs ls -a. Attackers and administrators alike use this for concealment, for example dropping payloads such as.bash_profile additions or hidden reverse shells in a user's home directory. The exam context of system hacking (M06) fits: hiding artifacts is a basic post-exploitation step on Linux hosts.
Why the Other Options Are Wrong
A. Tilde (~) is used by shells to denote the user's home directory (e.g., ~/config) and by editors for backup files, but a leading tilde does not hide the file from ls. B. Underscore (_) is merely a common name-prefix convention to force files to sort first alphabetically; ls still lists them normally. D. Exclamation mark (!) has shell history-expansion meaning and no relationship to hidden-file semantics, and it is generally awkward or restricted in filenames. Only the period prefix changes listing behavior, making C the only correct choice.
Community Comment Notes
The learner votes are unanimous for C, with commenters such as MustafaDDD stating "C is correct - Period (.)" and insaniunt echoing "C. Period (.)". No comment disputes the answer or raises a competing option, and LordXander and a307962 likewise mark C. One learner, nosavotor, expressed uncertainty about the ethical hacking concept itself rather than challenging the option, which the explanation above resolves.
Exam Strategy
Treat this as a quick-recall Linux fundamentals item: memorize the pairing "hidden file = leading dot" alongside the command ls -a (or ls -A) that reveals them. Do not overthink it by looking for a security or permission mechanism — hiding here is purely a name-prefix convention.
Frequently Asked Questions
Why doesn't starting a filename with an underscore hide it on Linux?
How do you view files hidden with a leading period on Linux?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
nosavotor 👍 1Im not certain about this ethical hacking concept
-
insaniunt 👍 2 Answered CC. Period (.)
-
MustafaDDD 👍 1 Answered CC is correct - Period (.)
-
LordXander 👍 1 Answered C..... C .....
-
a307962 👍 1 Answered C...c...
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.