Have you ever used a graphical configuration tool on Linux and wondered what it was actually doing behind the scenes? Well, here’s a tip to help you find which config files were being modified.

First, run the command

$ touch /tmp/now

All we’re doing here is to create a file with a timestamp of “right now”.

Now fire up your graphical config tool and make whatever change you want. Immediately afterwards, run the command:

$ find /etc -newer /tmp/now 2> /dev/null

This will show you all the files under the /etc directory (where most system configuration files live) that have been modified since you ran the ‘touch’ command. (My assumption is that this is system-wide configuration you were changing, not a per-user setting. All per-user settings, of course, are stored in your home directory, not under /etc.)

The technique isn’t foolproof — you may get some false positives (files that changed for some other reason), but it’s a pretty good guide.

Here’s an example — on Ubuntu I used the System -> Administration -> Login Window tool to change the theme used by the login screen. After this, the find command produced output like this:


$ find /etc -newer /tmp/now 2> /dev/null
/etc/gdm
/etc/gdm/gdm.conf-custom

Now that we know which file got changed, we can go a step further and investigate which entries in the file were altered. Begin by making a copy of the current configuration:

$ cp /etc/gdm/gdm.conf-custom /tmp

Now run the Login Window configuration tool again and make another change. Afterwards, display the differences between the original configuration file and the new one:


$ diff /etc/gdm/gdm.conf-custom /tmp/gdm.conf-custom
79,82c79
< GraphicalTheme=circles
---
> GraphicalTheme=HumanCircle

Now, you can see exactly which lines within the config file were changed.

Chris Brown

About the poster

Dr Chris Brown is Impartica’s Linux course leader and has been using UNIX for over 30 years. He is author of the book “UNIX Distributed Programming” published by Prentice Hall, and of “SUSE Linux” published by O’Reilly. He also writes a regular column for the UK magazine “Linux Format”.