Clearing out the Cruft with Linux Tools and Best Practices

As covered in an earlier post, I’ve got some serious work under way to sync and backup my computer files across several computing platforms and devices. I’m reinstalling some machines as part of that work. At that time, I’m cleaning out a bunch of accumulated cruft in the form of duplicate files and folders – plus old OS and application configuration data – some of which has been carried over from as far back as my Windows 98 and SunOS 4 days!

So here’s my acquired wisdom on how to get this done under Linux.

  • Delete or archive off all dot (.) files. UNIX/Linux type operating systems store configuration and option information in hidden “dot” files in the user home directory. When moving to a new version of the OS, it is best to start with fresh dot files in most instances (prior files may confuse newer versions of programs, etc.) – there are just a few which are desirable to copy back (like your ssh keys and .mozilla (Firefox/Thunderbird) configurations). If you uninstall programs, the associated dot files may be left behind, taking up space. So delete or archive these files off and copy back only what you need after the new installation is done.
  • Eliminate Duplicates. Over time, I did things like copy over from one machine to another a copy of an important directory, or upload the content of our camera’s memory card. This often results in duplicate files and folders. The best way to fix this is not to do it (which is what will be fixed with my sync/backup solution) but it can happen nonetheless. There are two good tools I’ve found to help clean this up.
    • FSlint: Among the capabilities of this tool is a duplicate files finder. It doesn’t just check for duplicate file names but does more comprehensive comparisons so that it will catch the same file under different names (even extensions!) and eliminate false positive matches using checksumming, etc. You can then delete off duplicate files, if desired, or replace them with hard links to a single copy to save space.
    • Meld: This tool includes a directory comparison capability, for up to three directories at once. It will tell you where the files in the directories are the same, where files exist in only some of them and/or if the file attributes match (eg: permissions, modification date or size). The tool allows for merging/moving files to consolidate down to a single “master” copy. Way better than trying to do the same through command line or file manager tools. Highly recommended!

Will add more later on ways to:
Slim down applications data.
Eliminate unused languages/localizations.
Clean out cached information.

This entry was posted in Computer, Linux. Bookmark the permalink.

3 Responses to Clearing out the Cruft with Linux Tools and Best Practices

  1. Brian says:

    When deleting the .dot files did u have to do it one by one? A difference in Linux from Windows is that in Windows you can “select all” and then hold down the Ctrl key to deselect the ones you want to keep, or conversely you DON’T “select all” and then, holding down the Ctrl key, you can select all of the ones you don’t want, this all depending on if there are more or less you wish to delete. Either way is a fast way to delete unwanted files/folders etc and even to organize photos (boy I tied my virtual tongue up saying alla dis just to ask a simple question, lol, but I’m sure you understand what I am saying.)

    • Don says:

      Brian, it may depend upon what file manager you are using, but in my experience most Linux file managers allow you to do the same sort of multi-selection you can do in Windows. So, when viewing a list of files you select the first one wanted and then either press shift while selecting another file (which will select all the files between the first and last as well), or press control while selecting (which will add or remove additional single files) from multi-select. Then you can perform whatever action is wanted on all the files selected at once.

  2. Don says:

    I’m back looking at tools in this space and came up with a couple more duplicate difference/merge tools:

    diffuse (in the Debian/LMDE repositories, just install via your package manager)
    DiffMerge – cross-platform for Win, Mac, Linux but not in the Debian/LMDE repos.

    And an open source Windows tool that may run under a VirtualBox Win 7 machine – it has a nice summary status representation for directories comparisons:

Leave a Reply

Your email address will not be published. Required fields are marked *