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 file with the DNS value 8.8.8.8, if some of network URLs are accessible via 192.168.1.1. The modified cat /etc/resolv.conf will look like the following:

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

There are a lot of other config files available in a system such as ssh, passwd, profile, sysconfig, crontab, inittab, and so on, in the /etc/ directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.123.182