Another Bash One Liner To Delete Old Directories

We received a tip from blog readers Christian and Michael for alternatives to the command to delete all directories older than a certain period of time. These both work in bash and can be used in scripts to clean up old backup directories or any situation where you need to delete old directories from the command line.

From Christian:

find /home/backup/ -maxdepth 1 -type d -mtime +7 -exec rm -r {} \;

From Michael:

find /home/backup/ -maxdepth 1 -type d -mtime +7 -exec echo “Removing Directory => {}” \; -exec rm -rf “{}” \;

The first one works quietly, while the second one will display what is being deleted. These are probably faster than putting it into a for loop, so feel free to use whatever works best in your particular situation!

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

Thoughts On the Google TV Platform

Just watched the Google IO stream regarding the release of Google TV.  My thoughts:

Good:

  • The platform is open. This is the way to go, and will allow developers to go hog wild and develop things that even the Google engineers couldn’t envision.
  • TV/Web Integration. The Google TV platform appears to have great web and video integration, including live TV. The overlays look beautiful and web/TV switches effortlessly. But that basically makes it WebTV.
  • Working with hardware partners. This gives the platform a much better chance of seeing the light of day. It appears they are working with Sony, Dish, Logitech and other hardware companies.
  • The Android market. Integration with this means you already have tons of apps at your disposal on your system.
  • Search integration. Will make it easy to find both local and online content.

Bad:

  • Needing an existing cablebox to bring in live TV. This is an uncessessary step – you should be able to bring in Live TV streams using a CableCard. Could support for this be forthcoming?
  • Uses existing TV infrastructure. The future is in IP TV.

Questions:

  • How expensive will the box be and will it be available from cable/satellite providers? If available from television providers (at least Dish) then it will be available for a monthly ‘rental’ fee. If Google tries to sell this as a stand-alone product, ala Tivo, it will be a bigger up-front cost that many consumers are not used to paying. However, Google may be able to make this cheaper than we think, because they subsidize services from ad revenue. Advertisers are willing to pay for information such as what viewers are watching. Google will be sitting on a goldmine of data.
  • How will this impact other “Television” set tops such as Tivo, BeyondTV, Boxee, MythTV? It greatly depends on adoption rates, cost and utility.

Regarding the issue with the existing TV infrastructure, this product could be revolutionary. I’m not sure if this is because they are trying to avoid stepping on the big cable providers toes but with a device like this the existing cable network is unnecessary. Google owns a lot of fiber, and therefore a lot of bandwidth. They could offer their own live IPTV offering, and it could be available directly on the Google TV platform. This is probably where they are aiming to go in 2 or more years. Its prohibitive to many companies at a reasonable rate because the cost to stream high definition television to many homes is great.

YouTube essentially already has the infrastructure in place for IPTV. They already have the ability to stream any live video stream in fairly decent quality. I imagine what is holding them back if the agreements with the content providers (channels) like Discovery, MTV, NBC Universal, etc. If the old don’t get on board soon, they will be in 5-10 years where the newspaper industry is now.

I am looking forward to what the Google TV platform is going to offer. A bonus would be if you could run it on additional hardware other than hardware offered by Sony or other companies. Since it is open source, this is a distinct possibility and we could see a lot come from this, even if the hardware itself proves unsuccessful. There is one thing Google has a lot of — vision — and it would be great to see that on your television.

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

One Line Linux Command to Print Out Directory Tree Listing

My professor sent us this little one liner (ok, I had to format it to 2 lines to fit in this blog. You know what I mean) which prints out the current directory tree:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' \
-e 's/^/ /' -e 's/-/|/'

What’s going on here?
Read More »

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

HBO GO Online Streaming Video Review and Screenshots

HBO GO has been in the works for a while now, and is an indication of what some networks are trying to do to add value to their subscription rate. Offering video for streaming online is definitely a benefit to a premium channel like HBO. And it is a glimpse as to what the future of online video will hold.

I recently got rid of my cable box and implemented a do-it-yourself solution. Since HBO is a premium channel and encrypted, they force you to either buy a cable box via subscription or also a cable-card (which they also charge for). This actually gives me a unique perspective on the service: would I pay for HBO to receive the HBO GO online only offering? Read More »

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon

One Line Batch Rename Files Using CSV Input File and awk

The Bash command environment, which is the namesake of this blog, is very flexible in that it allows you to manipulate the filesystem in many ways. Awk and sed are very powerful tools that allow you to do this rename with a simple one line command. This post will walk you through doing this with a Comma Separated Value (CSV) file and also using a simple regular expression to rename many files.
Read More »

Share and Enjoy:
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • StumbleUpon