First off, what's a kernel? Well, most every operating system has one, and Mac OS X's is called Darwin. A computer's kernel is a sort of program which doles out memory (RAM) to applications, what writes data onto the disk, and other sorts of things like that. A kernel is an integral part of the Mac OS X operating system. When thinking of the makeup of an operating system, it is helpful to think in layers, with the things a user sees at the top, and other things at the bottom. A kernel would qualify as one of those 'other things,' residing out of sight, right near the bottom.
Secondly, what's a volume? I've mentioned these a few times, and may have unknowingly confused my loyal readers. Just so you know, a volume is the place where data is stored on any sort of medium, such as a hard disk, CD, etc. You may be thinking "Wait, doesn't my computer write directly on my hard disk?" Well, a computer has to conceptualize the physical world by imaging everything as software, and in the case of conceptualizing storage mediums, your mac has to image the disk as a virtual place, which it calls a volume.
Your computer has a volume that was initially called 'Macintosh HD,' and this is "mounted" at start-up. "Mounting" a volume is loading it so that data can be written to or retrieved from it. You also mount volumes when you open disk images that some apps are stored in, as well as when you plug in a flash-drive.
Thirdly, why am I telling you this; isn't this sort of thing what Wikipedia's for? Well, let's just say that I was feeling generous today. Speaking of looking stuff up, you can do such things quite simply in Leopard with Safari's dictionary dialog. All you've got to do is mouse over the mystery word, then press "Command" "Control" "D." Wah lah! Absolutely majestic!
And there we are, at the end of yet another post, brought to you by the illustrious Peter Story.
As I hinted in the intro, the first and most widely known way Finder (Apple's file manager, which displays file location, etc. to the user) recognizes hidden files is by appending a dot to the name of the file/folder in question. For example, below I will use "mv" to rename a folder on my desktop. The original "path" (location and name) is on the left, followed on the right by any location changes and name changes I might want.
mv ~/Desktop/MegaPower ~/Desktop/.MegaPower
And Bazam! It's vanished. If you run the applescripts I've got available on my downloads site, or if your run:
ls -A
In the command line, you'll be able to see them, but otherwise no.
The other way is a bit trickier, and doesn't apply in a traditional Unix setting. As I've been able to piece together, the information executed in the following command is recorded in the concerned file's metadata (extra info that the system uses for cataloguing, etc).
mkdir ~/Desktop/UltraLord
SetFile -a V ~/Desktop/UltraLord
And there we go. Same effect, but without adding an annoying dot to the name of the file/folder. To help you remember:
SetFile -attributes Vistability/visability Path
A lowercase 'V' will make the folder visible again. Fun, but scary, right?
Malware will have a ball on Mac OS X if it ever manages to find a hole in the Mac's impenetrable armor.
The first command I'll tell you about is the "mv" command, which in addition to moving files, can also be used to rename them. When using it to move files, the syntax (way you right it out correctly) looks like this:
mv ~/Desktop/"Flipp'inSweetDocument.txt" ~/Documents/Text/"Flipp'inSweetDocument.txt"
First we typed "mv," followed by the original location of the file, and then the location we wanted it moved to. I used quotes because "mv" doesn't like my flipp'in sweet apostrophe. The other usage can be used in combination with this; all that's required is to change the name of the document in the first location to another, as seen below:
cd ~/Documents/Text
mv "Flipp'inSweetDocument.txt" "TotallyRadFile.txt"
And there you go, nice and simple.
The next command I'll get into is the command for making folders, "mkdir." To use it, type the following:
mkdir ~/Desktop/GnarlyDocumentReceptacle
You can also make folders without specify their location (path). Without telling "mkdir" where to put the new folder, it'll assume you want it in your current directory.
And now, the commands you've all been waiting for, the "sudo" and "su" commands. Here's a hint; they give you unlimited power. HAHAHA!!! "Sudo" can be used as a prefix to any other command. For instance:
sudo mkdir /System/TotallyRad
"Sudo" will ask you for your admin password, and after you've given it, you'll be free to do anything and everything on your system. But "su" (short for super-user) is even better. Whereas with "sudo" you must append it every time you issue a command, "su" only needs to be issued once (don't worry, it's not permanent; it goes away after closing your Terminal window).
To use "su" just type it by it's lonesome in the command line. However, in order to enable it, you must first enable the root user. In finder, go to /Applications/Utilities and open "Directory Utility." Next, authenticate by clicking the lock, and go to Edit>Enable Root User. Then make the password something cool.
A clear distinction between "sudo" and "su" is that while "sudo" asks for your admin password, "su" is asking for the password you entered for the root account in "Directory Utility."
Pheew! Well, hopefully I'll get a few more posts up during vacation.
Today's list is going to consist of the first five things I change whenever I'm starting fresh on a mac. For some you'll just have to find an obscure check box, but for others more terminal fun will be involved.
Wow that was a lot of work.
Thankfully, Apple has provided a couple ways to deal with most problems.
If your computer can't get past startup, the first thing to do is reset the PRAM, or perimeter random access memory. This stores things like the current date and time, and the default boot disk. This can be done by holding down "Command" "Option" "P" and "R." You can also check which boot disk your computer is trying to startup from by holding "Option" as the computer turns on. I know I've had problems after booting from external drives, then trying to start up without the previous drive connected.
If your computer still won't get past the white startup screen, now would be the time to try booting from another source. If you have your install disks that came with your computer, you can put disk number one in and boot by holding "C" as the computer starts up. Assuming this works, you should be able to use disk utility to take a look at the condition of your computer's internal hard disk and fix it if need be. Another thing you can try booting from is another mac that doesn't appear to be broken. This can be done with a firewire cable, and target disk mode. Target Disk Mode turns your computer into a big external drive. With this method, you'll want to connect the two computers with a firewire cable (while both are off), then start up the working one while holding "T"; if you do it right, a big icon should start bouncing around the screen. Next, start up your 'dead' computer while holding "Option" and when you're given the choice, choose to start from the other computer you're connected to. If you manage to start up successfully, try running disk utility to fix up your broken hard drive.
But what if you don't have another boot disk? Well, you can start up from the firmware/EFI (or memory that has rules for controlling fan speeds, etc.). If you have an Intel mac, this can be accessed by starting up while holding "Command" and "S." And for all you PowerPC users out there, hold down "Command" "Option" "O" and "F." From the command line interface you should meet yourself at, type the following, very carefully:
/sbin/fsck -f
And after that, type exit. Running fsck should fix up your hard disk nice and good.
But if your computer won't even turn on, just try unplugging your it, and leaving it for 15 minutes to a half hour. Then try turning it on. This problem stems from not using a functional power surge protector; your mac's internal circuit breaker (as I understand it) was tripped to prevent the excess electricity from burning out your RAM, processor, etc. I can vouch for the effectiveness of this technique myself, and I can also vouch for the importance of a good surge protector.
And if none of these tips work, then head on down to your local Apple Store. Unless a part is physically broken, the people behind the Genius Bar will usually be happy to repair your mac for free.
In the future I'll be updating both blogs at roughly the same time, so feel free to bookmark the format you prefer. Eventually I'm hoping to move this site to another URL, but that's a job for another day.
Personally, I feel this new site has more character, to be honest. Nevertheless, I'll admit it can be a bit more difficult to read. A high five to my sister for teaching me all the CSS I needed to know to make the layout as good as it is.
Today's list will be of the top 5 most useful (and shiny) utilities I've managed to get my hands on (for free!).
Today I'll talk about Applescript, Apple's awesome programming language that can save you a lot of time. But thankfully, you don't have to know how to program to use it.
First off, you'll want to enable the Applescript menu bar icon. So navigate to Applications/AppleScript/"AppleScript Utility.app" and open it up. Now you'll want to check the boxes next to "Show Script menu in menu bar" and "Show Computer scripts." You should see a little curled piece of paper appear in the upper right-hand corner of your screen.
If you click on the icon you should get a drop down list; this will contain all the scripts that came with your computer. They're stored in /Library/Scripts if you're interested in editing them. If you want to add your own to the list, you can either put them in there, or go to /Users/PeterStory/Library/Scripts (replacing PeterStory with your name). If there is no scripts folder there, you can make your own (just so long as you name it "Scripts").
A few scripts you should look into are any of the Finder Scripts, which can help you rename a bunch of files at once, and one of my personal favorites, "Download Weather Map" in the URLs folder.
But if you are a person who does want to learn to program AppleScript, I recommend:
AppleScript: The Missing Manual
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.
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?
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.
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 at least some sense of it.
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. More extreme, if you'll pardon the expression.
Remember, if you like my blog, add a comment, bookmark my page, or even send me an email. Check back tomorrow for more!
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.