Mac OS: Take command of your OS

Tucked away inside your Utilities folder, which lives inside the Applications folder on your Mac, is OS X's terminal window. If you grew up using DOS machines, you'll find it somewhat familiar - there's a black and white screen, some arcane text telling you that it's your machine, and a tiny blinking cursor.

That's where the similarity ends. The OS X terminal isn't DOS and, although some of the commands are similar, they generally won't work. Instead, the terminal is a window into the UNIX nuts and bolts that underpin OS X. The average OS X user shouldn't ever need to venture anywhere near the command line interface, but since you're not the average OS X user, it's probably time to have a rummage.

Finding your way around

First, there's no way around it: you're going to have to learn some basic UNIX commands. Fire up the terminal and you'll be greeted with 'Welcome to Darwin!' followed by the name of your computer (you entered this when you were setting up OS X) and then your short username followed by a $. This is your parent directory. Everything owned by you is splayed out underneath this directory in a series of branches. The easiest way to think about this is imagining your username as the trunk, and then each folder (or directory) as a major branch. All OS X users have the same initial branches, including desktop, music and documents.

You want to have a look at these branches using the terminal (and, yes, we all know you can do this much more easily through the Finder!). At the prompt, type in cd documents. You'll now see that your username has been replaced by the 'documents'. To have a look at what's inside that Documents folder just type ls, which stands for 'list' and will bring up a complete list of everything that's inside your documents folder.

From here, it's possible to modify and move anything within the folders that your username has rights to access. To return to the top of the tree, just type cd .. and you'll be back at your user directory.

When you're finished with jumping in and out of directories and generally moving around, it's time for something more interesting.

Disk repair

OS X has a pretty good disk repair utility that lives in the same directory as the terminal. This utility uses a command line tool called fsck-hfs to do its maintenance work on your hard drive. It also runs during automatic reboots, checking that the integrity of your hard drive hasn't been compromised.

To take a quick look at this command line utility, simply type fsck_hfs at the command line. This will provide a list of terms you can use to modify the way that the repair tool operates. This is where things start getting tricky, and we don't recommend that you spend too much time (at the moment) trying to run disk repair from the command line. It is, however, worth knowing that it's there, and understanding that behind OS X's pretty interface, tools like fsck-hfs are how things get done.

Uptime

Crashing was a fact of life under OS 9. Simply having a Classic machine that actually ran all day was a feat. OS X is the model of stability, and some people report that they've only shut down their machine when it's come time to update software. There isn't a pretty way to find out how long your machine's been up and running, but it's a snap from the command line. Simply enter the term uptime and you'll get a measure of how long your computer's been up. (The screen shot) shows that mine was up for only three hours, due to a software update session), as well as the number of users and a snapshot of how hard your computer's been working as a percentage of CPU load.

If that's not enough information for you, and you want to look super geeky in front of your Mac-mates, try using the top -u command, which continually updates the number of processes your machine is running. These could be user programs like iTunes, or machine processes like the Finder or the Aqua user interface. It will also show the percentage of the CPU that these processes are using, the amount of memory being accessed, and the amount of virtual memory being used.

Getting access to all this information, which is also available through an appli-cation called Process Viewer in the Utilities folder, is as easy as entering top -u at the command line. For the complete geek-in-charge look, drag the terminal window over to one side of your screen and let it update while you work.

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joshua Gliddon

PC World
Show Comments

Cool Tech

SanDisk MicroSDXC™ for Nintendo® Switch™

Learn more >

Breitling Superocean Heritage Chronographe 44

Learn more >

Toys for Boys

Family Friendly

Panasonic 4K UHD Blu-Ray Player and Full HD Recorder with Netflix - UBT1GL-K

Learn more >

Stocking Stuffer

Razer DeathAdder Expert Ergonomic Gaming Mouse

Learn more >

Christmas Gift Guide

Click for more ›

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?