Friday 18 January 2008

Great UNIXy tips

I've been using Linux and Unix for a long time and I am always trying to make people that aren't Linux users change and go to Linux. One of the things that I like about Linux is the command line and all the tools available to speed things up using just one line (or maybe a few lines.)

Here's an example:

You want to build a complex directory tree of ... I don't know, say 20 directories and subdirectories. Now instead of typing

mkdir first-dir/ ; mkdir first-dir/first-sub-dir ; first-dir/first-sub-dir/first-sub-sub-dir

You can do:

mkdir -p first-dir/first-sub-dir/first-sub-sub-dir

Nice... But how about those twenty directories in a more complex arrangement? That's easy too!

mkdir -p first-dir/{first-sub-dir/{first-sub-sub-dir,second-subs-sub-dir,\
third-sub-sub-dir},second-sub-dir/{another-dir,one-more},\
third-sub-dir/maybe-one-more-dir}/last-dir


Yes, that was one line! (Or multiple lines separated with a \ so that the command continues in a new line.)

What does that look like?

ls -R first-dir/
first-dir/:
first-sub-dir second-sub-dir third-sub-dir

first-dir/first-sub-dir:
first-sub-sub-dir second-subs-sub-dir third-sub-sub-dir

first-dir/first-sub-dir/first-sub-sub-dir:
last-dir

first-dir/first-sub-dir/first-sub-sub-dir/last-dir:

first-dir/first-sub-dir/second-subs-sub-dir:
last-dir

first-dir/first-sub-dir/second-subs-sub-dir/last-dir:

first-dir/first-sub-dir/third-sub-sub-dir:
last-dir

first-dir/first-sub-dir/third-sub-sub-dir/last-dir:

first-dir/second-sub-dir:
another-dir one-more

first-dir/second-sub-dir/another-dir:
last-dir

first-dir/second-sub-dir/another-dir/last-dir:

first-dir/second-sub-dir/one-more:
last-dir

first-dir/second-sub-dir/one-more/last-dir:

first-dir/third-sub-dir:
maybe-one-more-dir

first-dir/third-sub-dir/maybe-one-more-dir:
last-dir

first-dir/third-sub-dir/maybe-one-more-dir/last-dir:

So what do you think? Neat huh? Try doing that within your gui!

By the way, I found this on a page at IBM's site a long time ago. http://www.ibm.com/developerworks/aix/library/au-badunixhabits.html

There's tons of them, search the site for "Speaking unix" and Unix tips. There are tons of things that you can find. Some of them you know, some I'm sure you don't.

By the way, one thing of importance... remember not to put any spaces between directories. If you have a directory with a space in it, quote it!

mkdir -p test/{test ing} will not create a test directory with a test and ing subdirectory... ;)

-P

Wednesday 16 January 2008

Apple announcement and why I am not an analyst

So Steve Jobs announced the MacBook Air yesterday. It looks great and even my wife went "Wow, I can carry that in my purse!" Yes, she has a large purse.

Well, we got a new ultra-thin notebook, but unfortunately the tablet I was hoping for didn't materialize. I still have hope that someone will develop this or maybe even that the makers of the ModBook take some of the functionality of the new multi-touch software and make this tablet.

What do you think?

-P

Thursday 10 January 2008

2008 Tech

I like reading articles related to future devices to appear in our homes. As I mentioned before, one of the next Apple devices to be released would be a tablet like device with multi-touch capabilities. I don't really know that this is going to happen, I just read about it. I don't usually see a photo to go with it since the products are not actually announced, but the artist rendition of Apple's product looks very nice and even if Apple doesn't release it, someone should! I'm talking about the item posted at this website: http://stuff.tv/News/BIG-IN-2008-MacBook-Nano/

I hope we get to see more esthetically pleasing hardware. Lets hope it works too.

-P

Tuesday 8 January 2008

Back from Mexico

We've been back from Mexico for a while. We had a great trip and I must admit I wish it would have lasted longer. Even without internet access I was able to find things to do. ;)

Now back in the UK, I'm trying to get into a new rhythm for work. I'm starting earlier that before and that means getting up very early to get into the office. At first I thought this was going to be the "worst thing ever" but it's not.

Now it's time to concentrate on getting the MythTV setup working. This should be a couple of weekends of work and hopefully that'll be it!

There's a few things I have to do around the house though... I think I am going to have to run a new antenna cable from the outside, but that's not too bad. Anyway, this is part of the few weekends that I need to get it done.

-P