This page tabulates some common locations of configuration file in Linux. Different distributions store their config in different locations with different filenames. I've made no effort to specify the distribution (these example are from Mandrake 8/9, Redhat 7/8/9, SuSE 10) because it is intended simply as a search aid - if you can't find a config file in the location you'd expect, perhaps try one of these.
You can run slocate filename or find / -name "filename" (add the -mount switch to prevent searching on mounted partitions) to locate them.
Filename | Description |
---|---|
/etc/modules.conf | Holds kernel module configuration. |
/etc/rc.d/rc.sysinit | Ran once at boot time (the output of which you see as linux loads). Put low level configuration here (e.g. Configure DMA). |
/etc/rc.d/init.d | Directory containing scripts for various services. They can be controlled with the command service service_name start|stop|restart, or directly with /etc/rc.d/init.d/service_name start|stop|restart. There are hard (?) links in the /etc/rc.d/rc.0 ... rc.9 directory that control which of these services are started at the various runlevels. To prevent a service starting you can either delete the script, rename the script, remove the link from the runlevel-specific directory or remove the execute permission from the script. |
/etc/rc.d/rc.0 ... rc.9 | Control the services that are started at the various runlevels. The directories contain links to scripts held in /etc/rc.d/init.d |
/etc/rc.d/rc.local | Executed after the other configuration scripts. Put most of your system-wide high level configuration here (e.g. Turn on DPMS). |
/etc/inittab | Defines how the system is set up at the various run-levels. You can change the default run-level here by altering the line id:runlevel:initdefault: for the runlevel of you choice (e.g. id:3:initdefault to boot into the command prompt and id:5:initdefault to boot into X11). |
/etc/profile | Mainly defines the environment variables. (e.g. add to the path with PATH=$PATH:location). |
/etc/fstab | This defines the various mount points and their parameters. (See this introduction to mount and fstab and fstab and octal umasks for a more complete description of the umask parameter). |
/etc/services | Defines network services and their ports. |
/etc/sysconfig/i18n | This defines the locales. |
/etc/sysconfig/network-scripts | Contains network configuration scripts. Note that Redhat's GUI network tools will store their config in /etc/sysconfig/networking and overwrite the config in network-scripts. So don't use them. You have been warned. |
/etc/sysconfig/network | Contains network configuration scripts (SuSE 10). |
/etc/xinetd.d | Contains the services controlled by xinetd. |
/etc/xinetd.conf | xinetd configuration. |