What is /etc directory in Linux

The Linux file system hierarchy was thoughtfully created and has undergone some careful changes since its inception. Linux users may have noticed a few directories that are always present on all systems, such as the /etc directory and a slew of others that reside inside of root. Have you ever wondered what this directory is specifically for, and how it became such a staple for the Linux operating system? In this tutorial, you will learn what the /etc directory is used for on a Linux system.

In this tutorial you will learn:

  • What is the /etc directory used for?
  • History of the /etc directory on Linux
What is /etc directory in Linux
What is /etc directory in Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

What is the /etc directory in Linux?




In the 1970s, the /etc directory became a part of early Unix versions. This was mostly used as a catch all for files that did not meet the categorical requirements to be placed in the other default directories like /bin, /dev, /lib, and /usr. Fast forward 50 or so years, and the /etc directory has made it onto all (or nearly all) iterations of Unix, Linux, and BSD since then.

DID YOU KNOW?
Did you notice that all of the default directories mentioned above were kept to three letters? This was a common convention in early versions of Unix, but was eventually dropped. We still see all of these original directories to this day.

As programs became more robust and started allowing administrators to apply changes by editing configuration files, the /etc directory gradually became known as the one stop directory to find all of the system’s configuration files. These days, this still mostly remains true, and the /etc directory contains nearly all of the configuration files for the various programs on a Linux system.

Let’s remember that “etc.” means “et cetera.” In the context of an operating system, this can basically mean “any file that would not belong somewhere else.” This original meaning still holds true, too, and is why you will sometimes find more than just configuration files inside of the /etc directory. Unofficially, though, the /etc directory is principally reserved for configuration files.

As a Linux user or system administrator, you may find yourself digging through the /etc directory quite often. Editing configuration files is how you modify the behavior of the programs on your system.

Closing Thoughts

In this tutorial, we learned about the /etc directory on a Linux system and found out what it is used for. In case your first instinct is to use the /etc directory to store your miscellaneous files, keep in mind that this is a system directory meant for configuration files. Outside of modifying these configuration files, there is not much reason to be poking around in /etc.



Comments and Discussions
Linux Forum