What is the interrupt key for Linux command "less"

  • Questioner

    When you do shift-f with less, you can see the file update in real time, and you get the "Waiting for data...(interrupt to abort)" message.

    The updating works fine, but what is the interrupt? nothing seems to work (Ctrl-C, Esc, Ctrl-I etc). I always have to kill the terminal which is a pain.

  • Answers
  • Randy Orrison

    Ctrl+C works for me. When I use the F command in less, it says "(interrupt to abort)". The "interrupt" that it's referring to is whatever key is bound to the terminal interrupt. The command stty -a shows the relevant terminal settings:

    speed 38400 baud; rows 50; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

    It's the intr = ^C that shows that interrupt is generated by Ctrl+C.

    If you do stty -a what does it show?

  • Related Question

    cpu - difference between IRQ and Interrupt Priority level
  • Tony The Lion

    Can someone tell me if the IRQ of a device is different to the Interrupt Priority level?

  • Related Answers
  • shf301

    An IRQ is an hardware interrupt request from a device. It is a hardware signal with alerts the CPU that external hardware wants it's attention. The interrupt usually causes the CPU to immediately stop what it was executing and jump to different code, usually an interrupt service routine that was registered earlier.

    Then once the CPU is executing an interrupt service routine, what should happen when another interrupt request comes in while the CPU is processing a different interrupt? Interrupt priority level is what answers that question. The simplest priority seem, as pointed out in Wikipedia, is an interrupt disable setting. So while servicing an interrupt, all other interrupts will not interrupt the processor (they will no be lost, they will be serviced once the current service routine is finished). With more complex priority scheme, some interrupts will interrupt others.

    For example, maybe the hard drive interrupt has a higher level than the keyboard, since the hard drive speed is important and no one is going to notice a < 1ms delay in processing a key press.

  • pavium

    No, they're not the same.

    The IRQ is a hardware interrupt signal used to tell the CPU that something needs its attention.

    It's been a while but I don't think there was any priority implied by the different IRQ signals.

    Interrupt priority will be assigned to software interrupts, meaning that some are considered more urgent than others.