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.