02Home & Garden · Updated
What Does a Period Mean in a File Path?
Short answer
A dot can mark a hidden file or current folder
In a file path, a period (.) can mean the current directory, mark a hidden filename on Unix-like systems, or separate a filename from its extension. Its meaning depends on where it appears and which operating system is interpreting the path.
Three common meanings of a dot
A period in a path does not have one universal meaning. Its position matters. For example, a dot at the start of a path component, one between a filename and its extension, and two dots together are interpreted differently.
- Current directory: A standalone
.commonly refers to the directory the program is currently using. Thus,./notes.txtmeans a file namednotes.txtin that directory. - Hidden-name prefix: On Unix-like systems, a filename beginning with a period, such as
.config, is treated as hidden by many standard tools and file browsers. - Extension separator: In a name such as
report.txt, the period conventionally separates the base name,report, from the extension,txt.
These conventions can overlap. In ./.config, the first dot is the current-directory marker; the second is the first character of a hidden filename.
How a dot works in a path
A path describes where a file or directory is located. It is made of components separated by a delimiter: usually forward slashes (/) on Unix-like systems and Windows paths, and either forward or backslashes in many Windows contexts. The operating system or application interprets the components according to its rules.
When . appears as an entire path component, it means the current directory in common command-line and filesystem conventions. For instance, if a command is running in /home/sam/projects, then ./draft.md refers to /home/sam/projects/draft.md. The dot is not part of the filename in that example.
A related component, .., means the parent directory: one level above the current directory. From /home/sam/projects, the path ../notes.txt points to /home/sam/notes.txt. These are called relative paths because their destination depends on the current directory. An absolute path, such as /home/sam/notes.txt on a Unix-like system or C:\Users\Sam\notes.txt on Windows, starts from a defined filesystem root instead.
Applications may normalize paths by resolving . and .. components, but not every program handles paths identically. Permissions, symbolic links, network locations, and application-specific rules can affect what a path ultimately reaches.
Hidden filenames and operating-system differences
On Unix-like systems, including Linux and macOS, a leading period conventionally marks a name as hidden. Examples include .bashrc and .config. “Hidden” generally means that ordinary directory listings or file-picker views may omit the item unless hidden files are shown. It does not mean the file is encrypted, protected, or inaccessible.
Windows does not use a leading period as its general hidden-file setting. A name such as .settings can be a valid filename, but whether Windows treats it as hidden is controlled separately by file attributes and display settings. Consequently, a dotfile copied from a Unix-like system may not be hidden in a Windows folder, even though its name still begins with a dot.
Hidden configuration files often store preferences or application settings. Avoid deleting one just because it is not visible in a normal listing: an application may rely on it. If you need to inspect hidden items, use the file manager or command options appropriate to your operating system, and check the relevant help documentation because menu labels and commands can vary.
Dots in filenames and extensions
In ordinary filenames, a period often separates the base name from an extension. In photo.jpg, for example, jpg is commonly used to indicate an image format. Extensions are useful clues for users and applications, but a filename’s extension alone does not guarantee what its contents actually are.
Names can contain more than one period. In archive.tar.gz, people often read tar.gz as a compound extension. In meeting.notes.txt, the final period conventionally separates the extension txt, while the earlier period is simply part of the base name. Programs may apply their own rules when deciding how much of a name counts as an extension.
A name consisting only of a leading-dot component, such as .profile, is commonly treated as a hidden filename on Unix-like systems rather than as a name with an empty base and an extension. Exact display and parsing behavior can differ among file managers, shells, and software libraries.
Common misunderstandings and path problems
A frequent misconception is that every period in a path means “current folder.” That is true of a standalone component such as ./, not of every dot character. In images/logo.svg, the dot is part of the filename’s extension; in ./images/logo.svg, the first dot component refers to the current directory.
Another misconception is that the dot in a filename makes the file hidden everywhere. On Unix-like systems, it is the position at the beginning of a filename component that matters. A dot elsewhere, as in final.version.txt, does not by itself make the file hidden.
When a path fails, check the details rather than changing dots at random:
- Confirm the current directory if the path is relative.
- Check spelling, capitalization, separators, and whether the file or folder exists.
- Determine whether a leading dot is part of the actual filename or a current-directory component.
- Check whether a file browser is hiding dot-prefixed items.
- Remember that an extension is part of the filename, even if an application visually hides it.
Paths copied into scripts or commands can also be interpreted by a shell, which may expand special characters or apply quoting rules. A literal filename containing spaces or punctuation may need to be quoted or escaped according to that shell. The period itself is usually ordinary within a filename; the special meanings arise from the filesystem or the program’s path syntax.
Frequently Asked Questions
What does ./ mean in a file path?
./ means “from the current directory.” For example, ./data.csv points to data.csv in the directory where the command or program is operating.
What does ../ mean in a file path?
../ means the parent directory, one level above the current directory. The exact destination depends on where the path is being resolved.
Does a dot at the start of a filename make it hidden?
On Unix-like systems, a filename beginning with a dot is conventionally hidden from ordinary listings. Windows uses separate hidden attributes, so a leading dot alone does not generally hide a file there.
Is the dot in a filename part of the extension?
Usually, the final dot is treated as the separator between a filename’s base and extension, as in readme.txt. Applications can use different rules, and extensions do not prove that a file’s contents match its name.
What does two dots mean in a path?
As a complete path component, .. refers to the parent directory. Two dots appearing within a longer filename do not automatically have that meaning.
Related
- How to Store Kale in the Fridge So It Stays Fresh
- How to Uninstall Opera GX Completely
- How to Organize Word Documents Into Folders
Further reading: Microsoft Support. Details can change, so check the official page for anything that matters to you. Spotted a mistake? Tell us. How we write an answer.