UNIX For Dummies [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

UNIX For Dummies [Electronic resources] - نسخه متنی

John Levine, Margaret Levine Young

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Fifty Ways to Kill Your Process

The usual way to get rid of a process you started from the shell is to press the interrupt character, which is usually Ctrl+C, although sometimes it’s Delete. In most cases, the rogue program gives up peaceably, and you end up back in the shell. Sometimes, though, the program arranges to handle Ctrl+C itself. If you use the ed editor (if you’re a masochist) and you press Ctrl+C, for example, ed returns to command mode rather than give up and throw away any work you have done. To exit ed , you have to use the q command.

If the interrupt character doesn’t work, you can up the ante and use the quit character, generally Ctrl+\ (a reverse slash or backslash — not the regular forward slash). The quit character not only kills the program but also saves the dead body of the process (this description is awfully morbid, but we didn’t invent these terms) in a file named, for arcane historical reasons, core (or maybe programname .core ). The shell then gives this requiem:

Quit (core dumped)
This message tells you that the process is dead and that its body has been put on ice with the filename core .

Most programs that catch Ctrl+C give up under the greater onslaught of Ctrl+\. If the program you were running is one written locally, your system administrator may appreciate your saving the core file, because it includes clues about what was going wrong when you killed the program. Otherwise, delete any core files with rm because they’re a waste of space.

Because a program can immunize itself to Ctrl+\ (ed , for example, just ignores it), the next possibility is the stop character (always Ctrl+Z). The stop character doesn’t kill the program; it just puts it to sleep and returns you to the shell. (See Chapter 13 for more information about what Ctrl+Z really does and how it can be useful even with programs you like.) After you’re back in the shell, you can apply the stronger medicine described in the following section.
Warning For Ctrl+Z to work, your shell must do some of the work. Old versions of the Bourne shell aren’t up to it and ignore Ctrl+Z. The C, BASH, and Korn shells are Ctrl+Z-aware.

/ 213