What does the period (.) mean at the start of a filename in a terminal command?

In chmod -R 421 .gimp, what does the period mean directly preceding the g in gimp? Is that similar to the * wildcard?


The dot in that situation is part of the filename and has in the Linux/Unix context the meaning that the file or directory is hidden, you cannot see it in the file explorer (Nautilus, which is default on the vanilla Ubuntu), unless you press CTRL+H.

And, if you only use ls in the terminal, you will not see it either unless you use the -a or -A flag with it (i.e. ls -a or ls -A or ls --all or ls --almost-all).

However, the dot (.) has different meanings in different contexts:

  • For example in a path (./file) it describes the current directory you are in, while ../file refers to file in the parent directory.
  • And there is even a command . which sources (runs) bash script files. So . ./file (mind the spacing) would source the script named file in the current directory.
  • and in a REGEX context, the dot means "any character".

.gimp in your example is a filename, the "." is the first character.

The significance of it is a normal ls (ls=list files) won't show files with "." as the first character, it only lists with ls -a (or list files --all)


Nothing. It's part of the filename.

You appear to have a directory called .gimp.

Period. (lol)

Any other discussion about it belongs in a question about why people choose certain filenames for things.


The leading dot in file or directory names doesn't carry any particular significance, as far as Linux itself is concerned. However, certain utilities (such as ls or Nautilus file manager) consider such filenames as "hidden", that is they ignore them in their output, and will only show them if you provide a specific option.

In reality, this originated with what technically can be considered a bug. Rob Pike, one of the original people who worked on UNIX team recounts (source):

Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on). When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:

    if (name[0] == '.') continue;

This statement was a little shorter than what it should have been, which is

   if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;

but hey, it was easy.

Two things resulted.

First, a bad precedent was set. A lot of other lazy programmers introduced bugs by making the same simplification. Actual files beginning with periods are often skipped when they should be counted.

Second, and much worse, the idea of a "hidden" or "dot" file was created. As a consequence, more lazy programmers started dropping files into everyone's home directory. I don't have all that much stuff installed on the machine I'm using to type this, but my home directory has about a hundred dot files and I don't even know what most of them are or whether they're still needed. Every file name evaluation that goes through my home directory is slowed down by this accumulated sludge.

I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake.

Nowadays, this sort of became a convention to call them "hidden" even though their contents are not hidden at all. A real hidden, or anonymous file/anonymous inode, would be implemented via opening file and holding its file descriptor open, but unlinking it from the directory, which makes the data itself to be accessible only to the program that is holding that file, and its child processes (preferably forked after unlinking the file), since child processes inherit file descriptors. In fact, this is how bash implements here-docs.

Very different story is when filename is itself a dot . or .., which actually have a bit of history behind them, and I suggest you read Why is the current directory in the ls command identified as linked to itself?