About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Home » Learning Curve » CLIX False Beginners

CLIX False Beginners (1)

Starting out for the first time or simply starting all over.

Buy It

Try It

This is an attempt to create a 'do it yourself' course in Unix and CLIX. The course will use CLIX rather than the command line (Terminal.app).

The current CLIX download contains 5,000 commands. This might be fine for people acquainted with the application but is likely to be bewildering for first time users.

A few things first in this first part, such as what CLIX is and how CLIX operates.

What is CLIX?

This discussion assumes you understand what a command line is. Find out elsewhere what you need to know if you don't already know it. Then think about coming back here.

CLIX is simply a convenient (safe) way to collect Unix commands and spare yourself the tedium of having to type them in each time. Unix admins can be very impressive when they rip off 250 character command lines with the greatest of ease. But that's a total waste of time and it's probably something you don't want to do all the time either. CLIX is very much the George Foreman 'set it and forget it' - you write it in one time and then use it as much as you want.

[This course will assume use of OS X 10.6 as there are several subtle but significant syntactical differences from earlier versions of Unix.]

CLIX is also part and parcel of all the 'system maintenance' utilities out there. They're invariably hiding Unix scripts under the bonnet. Whether for profit or fame or both, they keep these things hidden and prevent you from using your system to its full potential. Several of them have had grave and even dangerous deficiencies over the years. By harnessing the power of Unix yourself, you avoid those pitfalls and maintain total control of your computer.

CLIX is an extremely popular application for OS X, winning accolades and awards, voted the #1 power tool for OS X by iCreate Magazine. Typical kudos include 'amazing', 'awesome', 'superb', 'matchless', 'outstanding', 'five stars all around', 'perfect work', '100 stars'. See the CLIX product page for more such quotes.

CLIX is free. No strings. It's just free. Go get it. Over 150 engineers at Apple have it, most of the Macs at the NASA locations in the US have it. The list of clients is long and distinguished. Go get it.

The CLIX Command Sheet

Everything happens with the CLIX command sheet. Following is the CLIX command sheet. You invoke it both to create new commands and to edit existing ones. You create a new command with the shortcut ⌥⌘↩. You edit an existing command with ⌘↩. Or you could work it off the menu. Here at any rate is the CLIX command sheet.

CLIX command records are divided into four fields. The first three fields are arbitrary - to help you manage and sort your commands better. The fourth and final field is the command itself. This is what will be run by CLIX when the time comes.

The 'title', 'category', and 'description' fields are for whatever you want. The 'title' and 'category' columns are double-nested sorts in CLIX: clicking on either of these column headers performs a second sort on your other column at the same time.

Normally the 'title' column is used for your name for your command; the 'category' is how you choose to categorise your command; and 'description' is again an arbitrary field where you can put anything at all - notes, further info, etc.

The command line field is what gets run by CLIX. This is a single line. The field might look capable of holding multiple lines but no. [There are however ways to put entire scripts in CLIX.]

There are four buttons at the bottom of the sheet: 'close', 'copy', 'run', and 'save'. The 'close' button closes the sheet (without saving changes) at almost any time. The 'copy' button copies out the the contents of the output field to the clipboard. The 'run' button runs the current command; the button changes to a 'stop' button when a command is run so you have a way to stop it if you want. The 'save' button of course saves the current changes to your command.

There's another field, normally hidden out. Click at the far left of the sheet under the output field. The 'man page' field will appear. Type something in there such as 'ls' and hit ↩. You'll see what happens - you've just summoned up the Unix manual page ('man page') for the command you specified - in this case 'ls'.

You might have seen a little 'spinner' as the output window filled; this disappears automatically when the task is completed. You will also see now that the 'copy' button is enabled. So you can copy out the current output to the clipboard (and paste it in a text editor somewhere). The 'run' button isn't enabled because there's no command to run and the 'save' button isn't enabled because there's nothing to save.

You can drag the command sheet to any size you want - the size remains the same through all subsequent invocations.

You can dismiss the command sheet and then bring up a new one and you'll see your last 'man page' invocation ('ls') is still there. [There are other ways to get Unix help from CLIX; you'll look at those later.]

Create a File

Time to create a first CLIX command and then save a first CLIX command file. Open a new sheet and fill it in as follows. Click 'Save'. Then use the shortcut ⌘S to save the file. Call the file 'falsebegin.clix'.

Note you must type the extension as well. CLIX automatically opens files with the extension but you can use any extension (or no extension at all) if you want. (And CLIX can still open them but not by double-clicking.)

Now use the shortcut ⌘↩ to open the command again. Run the command.

You should get somewhat different results. The reason for this is CLIX protects you against strange and weird 'current working directories' if none is set.

The current working directory for any CLIX document (a CLIX window) is the directory the document is found in. The current working directory for any as yet unsaved CLIX document is your home directory. The current working directory is never root ('/') unless you specifically want it to be. For your own safety.

Time to move on to actually use the program.

What is 'ls'?

'ls' is Ken Thompson shorthand for 'list'. Say it to yourself and you'll get it. Ken never believed in wasting time typing. Unix commands rarely contain vowels. And it's considered better to spend a little time learning a new command's shorthand name than typing the full name for the rest of time. So 'ls' is 'list' and 'list' means 'list directories'. Or rather their contents.

Given no further information at all, 'ls' will list - in its simplest form - the current working directory. The current working directory is just what it sounds like - a place marker for where you are in the file system. That's all. Your Terminal.app always uses a 'CWD' and so does CLIX.

ls can also take a lot of command line arguments (sometimes called switches). These are characters prefixed by a hyphen or dash ('-'). The switches can be squeezed together so you don't have to repeat the dash character all the time.

ls can also take the name of some other directory to list. Note that the switches must precede the name of the target directory to list.

You can also specify more than one target directory.

Understanding what all the ls switches mean is just about the same thing as understand what Unix is and becoming a Unix geek. This course will delve first into use of the command ls.

You'll fill in your commands all by yourself; at a later time the 'solutions' will be made available. But they're not going be made available now - for now you'll have to work. Clicking around passively in the command files nets you nothing - you never learn to actually use the app. So don't cheat - don't wait for the solutions - do the labs now. For your own good.

The key to using CLIX is to perfect the commands you want, save them in a way it's easy for you to get at them later, and then double-click things instead of typing all that stuff in time and again. And there's no need to worry about dangerous typos once you've got the command working properly and saved it. 'WORM' - write once and run many times.

See Also
Learning Curve: CLIX False Beginners (1)
Learning Curve: CLIX False Beginners (2)
Learning Curve: CLIX False Beginners (3)

CLIX: Learn how to fish
Rixstep FTP: Download CLIX

About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Copyright © Rixstep. All rights reserved.