Sunday, September 28, 2008

Power Tip #5: Ejecting Flash Drives

Oh well. I guess I can't post everyday, can I?

Today's tip might at first sound a little dull, and probably more than a little obvious, but don't worry. It's not. Today I'll tell you how to eject a flash drive properly, no matter what.

Every once in a while everybody gets a volume (any sort of media; hard disk, zip disk, thumb drive, etc.) that refuses to unmount (be ejected). And instead of telling you what's wrong, Finder just tells you to "Try quitting applications and try again." And naturally, some of the times, even once you've done all that, you still can't get the thing ejected.

The first thing you'll need to do is fire up your trusty old terminal and type in "sudo lsof." It should ask you for your admin password, which is perfectly normal. The "sudo" command takes your admin password, and grants you superuser privileges for a limited amount of time (superuser meaning you can do whatever you want). "lsof" is an abbreviation for "list open files." Now in a couple seconds, your entire terminal window should be filled with a list of every open file on the entire computer.
With that list in hand, all we need to do next is search for whichever process is accessing your drive, and kill it. In case you haven't noticed yet, in the command line all mounted volumes other than your start-up on are in the folder "volumes" in your root directory. So to search ("Command" "F") for any files being accessed on your flash drive, search "/volumes/"name of volume"". And on the same line as those words, you should find the name of the offending process. Usually "mds."
And lastly, just run the "killall" command I taught you earlier.

Even if you rarely have to go through all that, the wow factor you'll get when you do will more than make up for reading this whole entry. Trust me, I've done it.

Thursday, September 25, 2008

Power Tip #4: A Powerful List of Unix Commands

No post yesterday? No post! Hopefully I won't get into that habit...

Today I'll be sharing my favorite unix commands with you. I'd write a bulleted list, but I don't think that'd be substantial enough. Just as a note, yesterday's lesson really wasn't terribly applicable to any one certain task. It was just something that every hardcore mac user should know. Today's commands are going to be a lot more useful for everyday situations.


The first command you should learn is probably "killall." Usually to quit an frozen application all you'd do is press "Command" "Option" "Escape." But there are times when that won't work.
To run the "killall" command in Terminal, type "killall Activity\ Monitor," filling in "Activity Monitor" with the name of the application you need to quit. However, just like most unix commands, each command has a few different derivatives that can be used by appending "-X," replacing "X" with another letter or number. For the variation I have in mind, you need to append "-9" to "killall." With this, it'll terminate pretty much any process you have the rights to. And as a note, unlike yesterday's "cd," "killall" is case sensitive, meaning that it won't work if you put a capital letter where a lowercase should be, and vice versa.

And the second command is "emacs." Plain and simple. What that'll do is open the command line word processor aptly named "emacs." Normally that'd be pretty boring, but besides being a pretty awesome text editor, emacs also plays games. Press "control" and "X" then type tetris and you'll see what I mean. You also may want to try "dunnet," an RPG. To quit emacs, press "control" and "X" followed by "control" and "C."

And last, but most certainly not least, is the "man" command. Rather than having anything to do with men, this command launches a manual program. To use it, type "man killall," replacing "killall" with the name of any other command you want to learn more about. You can even try "man man" if you want. To quit, just press "q."


And there's the post. If this sort of thing is something you're interested in, try downloading the application CLIX from:
rixstep.com/clix/
I highly recommend. Just try not to mess up your computer with all that power, OK?

Tuesday, September 23, 2008

Power Tip #3: A Beginner's Guide to Terminal

Hooray, a new post! Get ready for some reading!

But before I get into any actual instructions, it's important to realize that Mac OS X is fundamentally different from OS 9 and all previous revisions of the macintosh operating system. The key difference being that OS X is based on BSD Unix.

But what exactly does that mean for us? Well whereas before OS X the command line was completely absent, in Apple's new OS it makes its proud debut. The "Terminal" application is an application for typing in the command line. So instead of clicking buttons with our mouse, we'll be typing text, or commands. There are innumerable things that can be done in Terminal, but today I'll stick to the basics.

One of the most simple, yet probably most important commands you'll ever learn is the "Change Directory" command, abbreviated "cd." "Change Directory" is just a fancy way of saying "move from one folder to the next." Thankfully, navigating in the command line is very reminiscent of column view in Finder.
So fire up Terminal and type the following: "cd desktop"
What that'll do is move you from your starting folder (by default your home folder: the folder that has your name on it) to your desktop. To go back, just type: "cd .." and you'll be moved back up one directory. Just like pressing the left arrow in column view.

Now that's great, but what if you don't have every folder in your computer memorized; what if you need to see the names of all the folders in your current directory? That's where the "ls" command comes into play. Type "ls" and you'll get the name of every folder or file in your current directory.

After you've played around a bit, and you're feeling a bit more comfortable, try launching or opening something through the command line. For our purposes, let's try opening "Activity Monitor." Type "cd .." until you're at what's called the "root directory" (you can be sure you are if after running "ls" you can see the applications folder). The "root directory" is commonly abbreviated "/" so keep that in mind. It's the folder where you can't back up anymore. Now, type "cd applications" and after that "cd utilities." You can use the command "open" followed by your target file to open it. Having trouble? You should be! There are two problems. The first is that spaces aren't commonly recognized in the command line. There are two ways to get around this. One is by typing a backslash (\) before the space, and the other is by putting quotations around the two words separated by the space. The second problem is that when opening a file or application, you have to add the extension. For applications, ".app" will do the trick.
So to open "Activity Monitor," type either "open "activity monitor.app"" or "open activity\ monitor.app"
Success! If you did that, you have every right to be very proud of yourself.

Now that you've hopefully got the basics of moving through folders and opening files via the command line, next I'll teach you a few specialized commands.

Just as a note, you'll often see the paths (locations) of files referred to as "/application/utilities/activity\ monitor.app." That's a major thing to remember, especially for future posts.

Monday, September 22, 2008

Power Tip #2: Window Management

Hoo hum. Time for another blog post.

Keeping with the subject of windows, today I'll teach you a couple ways to make yours a bit more manageable. First, let's talk about hiding windows. Many users are well aware of using "Command" plus "H" in order to hide all the windows in the current application. However, there's also "Command" "Option" "H," which will make the windows of all other applications disappear instead. Also be sure to note that "Command" "H" can be done in the Application Switcher referred to yesterday.

Wait, there's more! What happens when it just isn't enough to hide all your windows; what if you want them all closed? Well, it just so happens that "Option" clicking the 'X' bubble, or any of the other bubbles (the buttons in the upper left hand corner of all windows) applies that action to all the windows in a given application. So if, for instance, you had 200 Finder windows open, "Option" clicking the 'X' bubble would close them all. Or if you're a keyboard guy like me, "Command" "Option" "W" will get you the same result.

That's it for windows, tomorrow I'll discuss the Terminal, and how to make some sense of it.

Sunday, September 21, 2008

Power Tip #1: Navigating Through Windows

Alright! A blog probably really isn't much good without any cool stuff on it, huh?

You simply cannot consider yourself a real power-user if you can't navigate through windows with ease. And nope, I'm not talking about Microsoft's sorry excuse for an operating system.
I'm talking about moving between those little boxes on your screen. Without a mouse.

How, you ask? That's where the Application Switcher comes into play. Press and hold the "Command" key, then press "Tab." You should see a row containing all the applications you've got open (in 10.2 or older your dock should highlight an application instead). From here, you can now either press "Tab" again to move your selection right, or press the key above it (actually called an "Acute") to move it back left. This is a real easy way to change applications.

But what if you don't want to switch applications? That's easy! For flicking through the windows of a single app, press "Command" and "Acute" (look earlier if you didn't catch what that is). If you accidentally pass the window you were meaning to find, then try "Command" + "Shift" + "Acute." Pretty amazing, right?

If that strikes you as a bit basic, don't worry, things'll get better.

Remember, if you like my blog, add a comment, bookmark my page, or even send me an email. Check back tomorrow for more!

The Power-User's Guide to Macintosh

Greetings.
This is a blog for all those who consider themselves, or hope to become, power-users. Of the Mac.
I've been using a Mac for 15 years, and I'd certainly consider myself as such. So now I feel it's my job to pass on that knowledge to all of you.

Every week I'll try to add a few tips which'll help you make the most of your Macintosh experience, as well as just make you more productive in general.