DEV Community

Bady
Bady

Posted on • Updated on

It's not a bug, it's a feature! :D

Originally there was no concept of a hidden file. But every directory in Linux has two special directories inside it . (current directory) and .. (the parent directory). These are not useful to list as they exist everywhere, so they were filtered out of output. But the code to do so was too aggressive in an attempt to to both checks in a single line, effectively matching every file that begins with a dot. People found out and abused it to hide files, the bug was never fixed and people came to think of it as a feature.

Source: https://libredd.it/r/linux/comments/at05xh/why_do_hidden_files_in_unix_begin_with_a_dot/egxuvwh

Top comments (0)