A configuration file is a file on a computer that stores certain settings (the configuration) of computer programs or hardware components. The use of simple text files in the usual encoding on the respective operating system, such as ASCII or UTF-8, is widespread, so that they can be edited with a wide variety of programs, e.g. any text editor or on the command line. Configuration files can also be binary, compressed, or encrypted, among others. There are also programs that manage their configuration files completely by themselves. In such cases, the user does not have to or cannot deal directly with the corresponding configuration file.
Basically, there is no specific file format – each program or the developers of a computer program determine for themselves how settings are saved. A very simple way to store configuration options is to write them as variables in binary form as data in a file with a predetermined name (and absolute or relative path). However, this data is difficult to interpret outside of the program. In order for a configuration file to be read and modified outside of the program, many programs use text files as configuration files that follow a certain syntax, with the disadvantage that the program has to interpret the data when reading it (parse) in order to return it to its binary form.
There are some standardized file formats that are often used for configuration files. This is not least due to the fact that there are numerous program libraries for reading such file formats. The most common file formats include:
- INI (Initialization File)
- XML (Extensible Markup Language)
- YAML (YAML Ain’t Markup Language)
- TOML (Tom’s Obvious, Minimal Language)
- .properties (Java properties file)
- Property List
Basically, the file format used is not dependent on the operating system, but often applications use the same formats as the operating system they run on.
Unix and Unix-like operating systems – such as BSD, Linux, or macOS – use many different formats, making sure that they are easily editable text files. However, it is up to the respective program how it saves its configuration, so that in principle binary formats are also possible, although absolutely unusual for Unix.
Under Linux, applications usually store their own configuration files globally in the directory, which apply to all users and are usually created when installing applications, by the installer or package manager, or by a system administrator (root), or in the user directory (usually). Although files on Unix often do not have a file extension, configuration files sometimes have shortcuts/extensions such as , or , and almost always begin with a leading period in the file name in the user directory, which means that the files are considered hidden and are not displayed by default when the directory contents are displayed.
What is a Hidden File (dot file)
A hidden file is a file that is hidden from certain applications in an operating system. This is generally to increase clarity or to protect against accidental deletion of operating system components. The same applies to directories. Depending on the term, it’s called hidden directory and hidden subdirectory or hidden folder and hidden subfolder.
In Unix, hidden files are more or less accidental out of a hack. During the development of the Unix file system, the reserved file names were created for navigation within the directory tree as a reference to the current directory and to the parent directory. Since Unix follows the Everything is a file philosophy, the system and all programs are the same as any other regular file. In Unix, directories are also usually files. For example, one or the same as any other (sub)directory will work. However, and this was the problem, it would also be treated as a directory by all other Unix commands, e.g. when listing the directory contents.