Configuration files

Configuration or config files are regular files that contain settings for an application. During the initial stage of execution, many applications in Linux and UNIX read settings from config file(s) and configure the application accordingly.

Viewing and modifying configuration files

Configuration files are generally present in the /etc/ directory and can be viewed using the cat command.

For example, consider viewing the resolv.conf config file:

$ cat /etc/resolv.conf
# Generated by NetworkManager
search WirelessAP
nameserver 192.168.1.1

The resolv.conf file contains the order in which to contact DNS servers.

We can also modify a configuration file to meet our requirements. For example, we can add another DNS entry in the /etc/resolv.conf ...

Get Linux Shell Scripting Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.