Linux Blog

Cleaning Up Files & Directories

Filed under: Shell Script Sundays — TheLinuxBlog.com at 8:30 am on Sunday, August 19, 2012

While not really a shell script as such, this is shell related and  it just so happens to be Sunday.

Find Empty Directories:

find . -type d -empty > empty_folders.txt

Find Empty Files

find . -type f -empty > empty_files.txt

The issue with these two commands is that within my jumble of unorganized mess I have an abundance of version control repositories (mostly SVN) and tons of source code with empty, but needed directories. Fear not if you have the same problem, you can filter them out by using:

grep -v empty_files.txt svn

Duplicate File Removal

There are multiple ways to remove duplicate files. I used to think a  recursive md5sum script was the way to go but that was before I found the utility fdupes.
Install via your package manager if it’s available and use recursively like:

fdupes -r [directory] > duplicates.txt

With fdupes you also have the ability to symlink or delete files, although because of the amount of source code, I’d rather review it manually.


With these utilities I was able to merge copies of photos remove a bunch of old files and empty directories and am one step closer to being digitally organized. If you have the same problem, hopefully they will help you too. If you have any cleanup or organization tools, please comment and let me know.

Why I Love Open Source Software

Filed under: General Linux — TheLinuxBlog.com at 10:32 pm on Thursday, April 10, 2008

Have you been looking for a piece of software that does exactly what you want it to? Perhaps its a tool for a client, or an application that would just make your life easier. On a daily basis I always am thinking of new things that I would like my favorite applications to do.

I am going to be writing within the next couple of days about my favorite CHM tools. One of the useful ones I use is a great little tool and it gets the job done, but it doesn’t do EXACTLY what I want. This is why I love open source. I can simple grab the source and change it if I need to. That is the freedom you are given.

Well, I’m not exactly the best C coder in the world but, given time if the application is that critical to me I can make the changes. I can get help from communities when needed and read free information on the web all day long to help me get the job done. If I can’t figure out how to do it in the language the application was written in its not a problem, I can analyze the source code and possibly find a work around. One powerful work around for the CHM application is the Shell.

This is one of the reasons I love open source software. There are many others, feel free to chip in and say why you love open source!

Linux Cedega Download

Filed under: Linux Software — TheLinuxBlog.com at 4:33 am on Thursday, March 20, 2008

There are a few options when it comes to playing Windows games on Linux. Cedega is a great tool to allow you to play these games under a Linux system. I was recently browsing around to find the Cedega Download from CVS instructions and found the normal source that I got them from no longer had them. I was wondering if it was an issue with Cedega but came to find out that there is an easier way then that now.

Check out: http://winecvs.linux-gamers.net/

You can download a script called WineCVS.sh This script allows you to freely check out the source code for Cedega and compile it. WineX and other versions of Wine are also included. I would highly recommend paying for Cedega if you can afford it, if not its worth a shot to use the Cedega Download utility.

Package management on Slackware

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 6:38 am on Friday, December 21, 2007

People complain that Slackware is hard to use. I don’t believe that thats true. I don’t think that its any harder to use than any other Linux distribution. I also believe that there is perfection in simplicity. Believe me that it isn’t the easiest to set up but once its up it is actually easy to update and maintain once you learn how.

Despite popular believe Slackware does have good package management software. The main ones that come to mind are slapt-get, slackbuilds, pkgtools, swaret and slackpkg. Below is a small amount of information about each of them.

I’ve never myself used swaret so I don’t know too much about it other than its a package manager that manages dependencies. I also know that a new version will be released soon. If your interested in finding the best package management for Slackware you might want to check swaret out.

slapt is a mashup of the two words slack & apt. Those familiar with Debian or Ubuntu will know apt-get is at the heart of these systems, slapt-get is a clone of this system. Its been in Beta since its creation but works perfectly. There are graphical front ends for this software. I personally don’t use it because I can not find a fast repository in my area.

slackbuilds are kind of like the Gentoo package management. They are distributed with the source code on the Slackware DVD. They are basically scripts that help compile the source code. Its pretty easy to use, for more information visit: slackbuilds.org

pkgtools are the base of Slackware package management. Basically it is a suite of utilities that you can use to install, remove and upgrade software. The best source I’ve found for finding extra packages is linuxpackages.net.

My favorite for updating Slackware is slackpkg. It uses pkgtools to install and remove packages. It comes on the Slackware CD’s / DVD’s in the extras folder and is pretty easy to use. Basically you install it, select a mirror from the config file and then run:

slackpkg update

Once its finished doing its thing you can then do:

slackpkg upgrade-all

This will start a fairly lengthy process of downloading and installing all of the new packages. Other options are available such as options to install new packages, remove packages revert to vanilla system and many more. One thing I have to caution on is updating to current. Its not as easy as upgrading from release X to slackware-current all the time. This is due to the different versions of GCC, glib, solibs and various other types of libraries. Always read the UPGRADE.TXT or at least have a back up of all of your critical data before attempting to upgrade.

There are a lot of options, if your interested in running Slackware I suggest you try them all and then use the one you like. If you don’t want to run Slackware because another distribution suits you better try not to use the “I don’t use Slackware because its hard to maintain” card.