LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   End of File In Terminal Cannot Quit Sometimes (http://www.linuxquestions.org/questions/linux-newbie-8/end-of-file-in-terminal-cannot-quit-sometimes-699747/)

rtrahan 01-25-2009 06:56 AM

End of File In Terminal Cannot Quit Sometimes
 
Sometimes when I do a "ls | less" I will get to the end of the file and most of the time I can press CTRL+ D to get back to the prompt. Other time it does not work and I have to click on close and start over? Any other ways to get back to prompt?

Thanks in advance

repo 01-25-2009 06:59 AM

try to press
q
or CTRL-C

colucix 01-25-2009 07:14 AM

To exit from less, you can press 'q'. Other applications may have a different terminator, depending on the fact they expect an EOF (Ctrl-D) or a termination signal (Ctrl-C). For example you can use Ctrl-D to send the "end of input" signal when using
Code:

cat > textfile
other commands don't receive input from the terminal and you will stop them using Ctrl-C. For exemple when using
Code:

tail -f logfile
Another signal is Ctrl-Z that means suspend. This is useful when you launch a command from the terminal and you want to put it in background, for example
Code:

$ command
<Ctrl-Z>
$ # prompt returns here and the job is suspended
$ bg # this put the last (previous) job in background.

Hope this helps.


All times are GMT -5. The time now is 06:07 AM.