Archive for category Operating systems

What changed?

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”.

Introducing Dr Chris Brown

This week we launched our brand new course: Linux: A Comprehensive Introduction. This new course has been written by the respected Linux author and columnist Dr. Chris Brown, who will also deliver the course. Here we take a brief look at Chris’ career so far.

Chris Brown

Dr. Chris Brown has been using UNIX as a software developer and system administrator since its pioneering days over 30 years ago, and has used Linux professionally and at home for about 10 years. He has extensive experience in curriculum design, and in addition to Linux training he has written hands-on courses in UNIX/Linux system programming, network programming, PHP, and distributed computing, and has edited and provided instructional design support for many others.

In addition to his time as a Research Fellow at Sheffield University, Chris has had a “proper job” as a Product Manager for the training company Learning Tree International, which saw him living and working in Virginia, USA for a while.

Dr. Brown has taught UNIX and Linux extensively for more than 20 years, mostly in Europe and the USA but also in Canada, India, Hong Kong and Brazil. He provided in-depth technical training on SUSE Linux to Novell’s consultants and IT engineers. He developed training content for Canonical’s “Ubuntu Certified Professional” training and wrote their “Deploying Ubuntu Server” course, and was master trainer for their train-the-trainer program.

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”.

He is an ardent supporter of Linux and the Open Source movement and brings an enthusiasm, experience, depth of knowledge, and humour to the classroom to make for an effective and enjoyable learning experience.

Chris holds a BA in theoretical physics, an MA, and a Ph.D. in particle physics, all from Cambridge University. He also has RedHat RHCE, Novell NCLP and Ubuntu UCP qualifications and is a Ubuntu
Certified Instructor.

Links