Linux terminal commands.
Adam Michael Roach's picture

Delete All Empty Folders from a Directory

Have you ever had a bunch of empty folders in one place that you wanted to get rid of without needing to go through each one first and verify that is empty? The following command will do just that:

WARNING: DO NOT RUN THE FOLLOWING COMMAND AS ROOT UNLESS YOU ARE ABSOLUTELY SURE OF WHAT YOU ARE DOING. THIS COMMAND RESULTs IN A LOSS OF DATA AND MAY NOT BE RECOVERABLE.

find /path/to/scan c -type d -print0 | xargs -0 rmdir --ignore-fail-on-non-empty --parents

Related:
Adam Michael Roach's picture

Recursively Delete all Files in a Directory with a Specific File Extension

This is pretty straight forward. You have a directory with a large amount of files with a particular extension that you want to recursively get rid of. For example, you back up a directory from a Windows machine onto an external hard drive. When you mount that drive on a *nix box you are going to see a bunch of files throughout the directory structure such as thumbs.db, desktop.ini, etc. I don't need that and want to see them anymore. The following commands will solve the problem:

Related:
Adam Michael Roach's picture

Installing Adobe Flash 64 bit in Ubuntu 9.10 Karmic Koala

If you are like me, you probably installed Flash player from the repository, expecting it to work properly. Well, that just isn't the case. For instance, on YouTube or Hulu videos, I wasn't able to push the buttons without first right clicking, then left clicking twice. Weird, huh?

Here's how to get the Adobe Flash 64 bit Alpha for Linux working in Ubuntu 9.10 Karmic Koala.

First, close Firefox. Next, uninstall the following packages if you have them installed:

sudo apt-get remove flashplugin-installer flashplugin-nonfree nspluginwrapper

Adam Michael Roach's picture

Forwarding X over SSH

Often I want to do some quick administration on a box of mine but don't really feel like running a VNC session (aka slow) just to do it. That's where forwarding X comes in real handy. Our prerequisites are 1) an understanding of what SSH and X Windows is/does 2) having those tools at your disposal, and 3) the remote machine must be able to forward X.

Say for instance on our remote machine there is an X application that we want to run on our local machine without needing VNC. Well, first, fire up the terminal. We want to SSH (secure shell) into our machine.

Adam Michael Roach's picture

Converting bin/cue to iso in Linux

So, you've got a bin/cue in front of you and you're not quite sure what to do with it. Here's how I handle them. As usual, I'm using Ubuntu Linux, but these instructions should be the same no matter the distro.

First, you are going to need bchunk. Pull up a terminal or your gui package handler of choice and enter the following command:


sudo apt-get install bchunk

Syndicate content