Home » Questions » Computers [ Ask a new question ]

What is the interrupt key for Linux command "less"

What is the interrupt key for Linux command "less"

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.

Asked by: Guest | Views: 348
Total answers/comments: 2
Guest [Entry]

"As @RandyOrrison mentioned, ^C (control + c) is the appropriate interrupt character. Although, how less responds to this signal will vary based on the options provided at execution time.
Normally, an interrupt character causes less to stop whatever it is doing and return to its command prompt (i.e. not the terminal/tty prompt).
If instead, you want to signal less to quit and return to the terminal/tty prompt, you should use the -K or --quit-on-intr option. This will cause less to exit immediately (with status 2) when an interrupt character (usually ^C) is typed.

less manpage
-K , --quit-on-intr
Causes less to exit immediately (with status 2) when an interrupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to its command prompt. Note that use of this option makes it impossible to return to the command prompt from the ""F"" command.

less -K [filename]...
less --quit-on-intr [filename]..."
Guest [Entry]

"I was stuck in less with no argument over than the file I wanted to fast check from my terminal, Ctrl-c, Ctrl shift-c nothing worked.
Ctrl-z did the job :)"