Introducing UNIX and Linux |
Getting startedOverview |
EmergenciesWhat happens if you type in a command you realise you shouldn't have? It may be that UNIX will provide you with an error message indicating this; if, however, your command was a valid UNIX command that simply does something that is not what you intended, then the situation becomes more complex. The worst-case scenario arises if your command runs and causes
damage, such as deleting a file you did not wish to delete. In this
case, you probably cannot recover from the error, and you quickly
learn to be more careful in future! Fortunately, such mistakes are
infrequent, as there are few commands that will destroy data. More
common is the following: you write a program, try to run it, and
find that either it hangs (it sits there
apparently doing nothing) or begins to generate incorrect results.
You know something has gone wrong. The remedy is to
interrupt the command, which can be done by typing
ctrl-C, and will cause the command to terminate
immediately. This is not the same as ctrl-D, which simply
indicates to the system that the standard input stream has been
closed. Try this out - there should be a file called
The file O'Donnell odorous O'Dwyer Odysseus Odyssey o'er oersted of off offal Note, however, that neither ctrl-C nor ctrl-D will get you out of Vi. |
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck