My blog, keeping you up-to-date with my latest news.


Cleanup your Debian configuration files

Linux • 2015-01-04


If you like to keep your computer clean, you may want to cleanup useless configuration files.
I'm going to show you a simple command to purge them.

First we need to list installed package:

dpkg-query -f '${Package} ${Status}\n' -W

Grep them to list only config-files:

dpkg-query -f '${Package} ${Status}\n' -W | grep config-files$

And retrieve only the package name

dpkg-query -f '${Package} ${Status}\n' -W | grep config-files$ | cut -d" " -f1

You now be able to purge them with apt or aptitude.

Example with apt:

apt-get purge $(dpkg-query -f '${Package} ${Status}\n' -W | grep config-files$ | cut -d" " -f1)

<< Back to Blog Discuss this post




No comments


Add a comment

  • Please verify you are human