Delete residues configuration files

dpkg -l | grep ^rc | awk '{print $2}' | sudo xargs dpkg -P

0
By: kayowas
2010-01-24 14:23:37

These Might Interest You

  • This command is recursive and will delete in all directories in ".". It will find and delete all files not specified with ! -name "pattern". In this case it's file extensions. -type f means it will only find files and not directories. Finally the -delete flag ask find to delete what it matches. You can test the command by running it first without delete and it will list the files it will delete when you run it. Show Sample Output


    0
    find . -type f ! -name "*.foo" -name "*.bar" -delete
    sh1mmer · 2010-10-07 20:17:38 0
  • Alternate version: Delete all files older than one day, with a filesize other than 0 bytes starting from the current working directory. Remove the -delete parameter to see which files it would delete


    0
    find . ! -size 0c -mtime +1 -type f -delete
    cow · 2010-07-30 06:59:19 0
  • Shows all configurations to apt and dpkg, rarely changed, you probably still have the default configuration. Go ahead and explore your configuration if you dare, perhaps change your apt-cache directory, Dir::Cache "var/cache/apt/"; or the names of the log files. Show Sample Output


    5
    apt-config dump
    LinuxMan · 2011-12-13 19:11:02 1
  • This will, for an application that has already been removed but had its configuration left behind, purge that configuration from the system. To test it out first, you can remove the last -y, and it will show you what it will purge without actually doing it. I mean it never hurts to check first, "just in case." ;)


    -3
    dpkg-query -l| grep -v "ii " | grep "rc " | awk '{print $2" "}' | tr -d "\n" | xargs aptitude purge -y
    thepicard · 2009-04-28 19:25:53 3

What Others Think

dpkg -l | awk '/^rc/ {print $2}' | sudo xargs dpkg -P
sputnick · 435 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: