why we have rc word in config file names
The "rc" in configuration files, such as .bashrc
, .vimrc
, or .bazelrc
, stands for "run commands" or "run control." This convention dates back to Unix and Unix-like operating systems and is used to denote files that contain configuration settings or commands that are executed when a program or shell session starts or when certain conditions are met.
Origin and Usage
-
Historical Context: The "rc" convention can be traced back to the early days of Unix. In Unix, the shell (command-line interpreter) reads commands from various startup files when it starts. Files with names ending in "rc" were used to configure or control these startup behaviors.
-
Run Control: The "rc" suffix originally stood for "run control," indicating that these files controlled how the shell or other programs would run or behave during startup.
-
Variants and Extensions: Over time, the "rc" naming convention has been adopted for various configuration files beyond shell scripts, such as
.vimrc
for configuring the Vim text editor or.bashrc
for configuring the Bash shell environment.
Examples
.bashrc
: Configuration file for the Bash shell (bash
), containing shell commands that are executed when a Bash session starts..vimrc
: Configuration file for the Vim text editor (vim
), defining settings and customizations for Vim's behavior and appearance..gitconfig
: Configuration file for Git (git
), storing user-specific configuration options.
Usage Beyond Unix
While the "rc" convention originated in Unix systems, it has been adopted by other platforms and software tools that follow Unix-like conventions or aim for compatibility with Unix tools and practices. The convention continues to be used for various configuration files across different operating systems and software environments.