After running less command in -bash, instead of a prompt, I get "(END) ". What's happening, and how do I get the prompt again?

1

I run the bash command "less" on a .txt. After printing out the lines in the file, the name of the file and "(END) " is printed. But I do not get a command prompt again.

Other than closing the terminal window and opening a new one, I don't know how to proceed.

So, how do I move past this "(END) " to get a prompt?

Hap

Posted 2013-08-20T14:04:05.293

Reputation: 113

2Press h to see help. – choroba – 2013-08-20T14:08:13.373

Answers

5

When less reaches the end of the file, it displays (END). Just hit Q to return to the prompt.

For general reference, in the *nix world CtrlC will stop the current process, that will also return you to the terminal (though this does not work for less as you found out). Alternatively, you can use CtrlZ to send the current process to the background. You can then bring it back with fg. See help fg and help bg for details.

Oh and less is not a bash command, it is a program in its own right and has nothing to do with bash.

terdon

Posted 2013-08-20T14:04:05.293

Reputation: 45 216

I tried Ctrl C, but that doesn't seem to work in this case. But 'Q' did the trick. Thank you for that, and the less vs bash clarification. – Hap – 2013-08-20T14:17:06.140

1

See also: what to do when ctrl-c can't kill a process?

– slhck – 2013-08-20T14:19:07.323