In the last post we looked at /etc/passwd. That file is in the /etc/ directory, which contains all sorts of configuration files. This time, we’ll talk about that directory and some of the interesting files in it.
Like I said, it’s a configuration directory. For example, your computer has an IP address. If that’s a static IP address, then it’s going to be stored in a file in the /etc/ directory.
Every time you start your computer, it starts a lot of programs by default. For example, it starts init, the mail program, the program that runs DNS, the printing system, cron, and more. All of this is controlled by the files in /etc/.
There’s also some interesting files there. For example, /etc/hostname.
Remember cron? There’s a system file that runs all of the cron jobs for the system. It’s in /etc/ too, in /etc/crontab.
There’s also our friend NTP, it has a configuration file there too.
The /etc/ directory was designed so that there wouldn’t be configuration files all over the system, instead, they’d be kept in one place. This makes it much easier to manage the system, you don’t have to go searching in multiple directories to find the files.
Alpha:~ computerlamp$ cat /etc/hostname Alpha
Yup, there’s the hostname of my computer. Alpha.
Another file is /etc/motd, it contains the message of the day. When you first open a terminal, you see the contents of this file. Sometimes it’s empty, sometimes it will have important messages, and sometimes it just has silly things:
Alpha:~ computerlamp$ cat /etc/motd _______ < Alpha > ------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
Yes, that is cowsay in my /etc/motd file. I was feeling whimsical.
The point of the /etc/ directory is to have the configuration files in one place, not scattered all over the computer. It makes the system a lot easier to manage.
Plus, cowsay is fun! All motd files should use cowsay!