Turning Your Computer On and Off






Turning Your Computer On and Off

If you think that turning your computer on and off is easy, you may be wrong. Because UNIX runs on so many almost-but-not-quite-compatible computers — all of which work somewhat differently — you first must figure out which kind of UNIX computer you have before you can turn it on.

If a train stops at a train station, what happens at a workstation?

A workstation is a computer with a big screen, a mouse, and a keyboard. You may say, “I have a PC with a big screen, a mouse, and a keyboard. Is it really  a workstation?” Although UNIX zealots get into long arguments over this question, for our purposes, we say that it is. Most current UNIX systems are workstations.

Turning on a workstation is easy enough: You reach around the back and turn on the switch. Cryptic things that appear on-screen tell you that UNIX is going through the long and not-at-all-interesting process of starting up. Starting up can take anywhere from ten seconds to ten minutes, depending on the version of UNIX, number of disks, phase of the moon, and so on. Sooner or later, UNIX demands that you log in. To find out how, skip to the section “Logging In: U(NIX) Can Call Me Al,” later in this chapter.

 Warning  Turning off a workstation is a more difficult problem. Workstations are jealous of their prerogatives and do punish you if you don’t turn them off in exactly the right way. Their favorite punishment is to throw away all the files related to whatever you were just working on. The exact procedure varies from one model of workstation to another, so you have to ask a local guru for advice. Typically, you enter a command along these lines:

shutdown +3

This command tells the workstation to shut down (in three minutes, in this example). With some versions of UNIX, that command is too easy. The version we use most often uses this command:

halt

 Linux  If you use Linux, type this command to shut down the system right away:

shutdown now

The workstation then takes awhile to put a program to bed or whatever else it does to make it feel important, because it knows that you’re waiting there, tapping your feet. Eventually, the workstation tells you that it’s finished. At that point, turn it off right away, before it gets any more smart ideas.

An approved method for avoiding the hassle of remembering how to turn off your workstation is never to shut off your computer (although you can turn off the monitor). That’s what we do.

A dumb terminal

The traditional way to hook up to a UNIX system is with what’s known (sneeringly) as a dumb terminal. Nobody makes dumb terminals any more, but Windows PCs have a natural ability to play dumb, so they’re commonly pressed into duty as terminals. You run a terminal emulator program on a PC, and suddenly the mild-mannered PC turns into a super UNIX terminal. (Truthfully, it’s more the other way around: You make a perfectly good PC that can run Doom and other business productivity-type applications act like a dumb terminal that can’t do much of anything on its own.)

When you finish with UNIX, you leave the terminal emulator, usually by pressing Ctrl+X or some equally arcane combination of keys. (Consult your local guru: No standardization exists.) Like Cinderella at the stroke of midnight, the terminal-emulating PC turns back into a real PC. To turn it off, you wait for the PC’s disks to stop running (carefully scrutinize the front panel until all the little red or green lights go out) and then reach around and turn off the big red switch. If you don’t wait for the lights to go out, you’re liable to lose some files.

If you have a network installed, which these days has become so cheap that nearly everyone does, your PC running Windows probably has a network connection to your UNIX system. Windows 95/98/Me/NT/2K/XP, and the Mac OS (the Macintosh operating system) have the network stuff built in.

If you do have a network connection, you can use programs called telnet, ssh, or putty (described in Chapter 16) to connect to your UNIX system. After one of them is running and connected to your UNIX system, within your program’s window you get a faithful re-creation of a 1970s dumb terminal and you can proceed to log in.

After you connect, you use it to communicate with the computer that is running UNIX. If the terminal is wired directly to the computer, UNIX asks you to log in before you can do anything else (see the section “Hey, UNIX! I Want to Log In,” later in this chapter). If not, you may have to perform some additional steps to call the computer or otherwise connect to it.

An X terminal is similar to an extremely stripped-down workstation that can run only one program — the one that makes X Windows work. (See Chapter 4 to find out what X Windows are — or don’t. It’s all the same to us.) Turning an X terminal on and off is pretty much like turning a regular dumb terminal on and off. Because the X terminal doesn’t run programs, turning it off doesn’t cause the horrible problems that turning off a workstation can cause. You can get X software for Windows to make a Windows PC act like an X terminal, too. If you have such a PC, ask the person who set it up how to start it and stop it.



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows