风歌的blog

已搬家到 blog.imxjf.top
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

learning the unix operating system chapter 1

Posted on 2005-07-26 12:56  风歌  阅读(314)  评论(0编辑  收藏  举报

Some other common control characters are:

[CTRL-U]

Erases the whole input line; you can start over.

[CTRL-S]

Pauses output from a program that is writing to the screen.

[CTRL-Q]

Restarts output after a pause by [CTRL-S].

[CTRL-D]

Used to signal end-of-input for some programs (like cat and mail; see Chapter 3, Your UNIX Account ) and return you to a shell prompt. If you type [CTRL-D] at a shell prompt, it may also log you out of the UNIX system.

If the system doesn't respond for quite a while (and how long that is depends on your individual situation; ask your system administrator for advice), the following solutions will usually work. Try these in the order shown until the system responds.

  1. Press the [RETURN] key.

    You may have typed a command but forgotten to press [RETURN] to tell the shell that you're done typing and it should now interpret the command.

  2. If you can type commands, but nothing happens when you press [RETURN], try pressing [LINE FEED] or typing [CTRL-J]. If this works, your terminal needs to be reset to fix the [RETURN] key. Some systems have a reset command that you can run by typing [CTRL-J] reset [CTRL-J]. If this doesn't work, you may need to log out and log back in or turn your terminal off and on again.

  3. If your shell has job control (see Chapter 6), type [CTRL-Z].

    This suspends a program that may be running and gives you another shell prompt. Now you can enter the jobs command to find the program's name, then restart the program with fg or terminate it with kill.

  4. Use your interrupt key (found earlier in this chapter - typically [DELETE] or [CTRL-C].

    This interrupts a program that may be running. (Unless a program is run in the background, as described in Chapter 6, the shell will wait for it to finish before giving a new prompt. A long-running program may thus appear to hang the terminal.) If this doesn't work the first time, try it once more; doing it more than twice usually won't help.

  5. Type [CTRL-Q].

    If output has been stopped with [CTRL-S], this will restart it. (Note that some systems will automatically issue [CTRL-S] if they need to pause output; this character may not have been typed from the keyboard.)

  6. Check that the [NO SCROLL] key is not locked or toggled on.

    This key stops the screen display from scrolling upward. If your keyboard has a [NO SCROLL] key that can be toggled on and off by pressing it over and over, keep track of how many times you've pressed it as you try to free yourself. If it doesn't seem to help, be sure you've pressed it an even number of times; this leaves the key in the same state it was when you started.

  7. Check the physical connection from the terminal to the system.

  8. Type [CTRL-D] at the beginning of a new line.

    Some programs (like mail) expect text from the user. A program may be waiting for an end-of-input character from you to tell it that you've finished entering text. Typing [CTRL-D] may cause you to log out, so you should try this only as a last resort.

  9. If you're using a window system, close (terminate) the window you're using and open a new one. Otherwise, turn your terminal off, wait ten seconds or so, then turn it on again (this may also log you out).