Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-25-2009, 06:56 AM   #1
Registered: Jan 2009
Location: Georgia
Distribution: OpenSuse Fedora
Posts: 64

Rep: Reputation: 17
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
Old 01-25-2009, 06:59 AM   #2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
try to press
Old 01-25-2009, 07:14 AM   #3
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
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
cat > textfile
other commands don't receive input from the terminal and you will stop them using Ctrl-C. For exemple when using
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
$ command
$ # prompt returns here and the job is suspended
$ bg # this put the last (previous) job in background. 
Hope this helps.


prompt, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
manager of PID file quit without update while starting mysqld abyabahai Member Intro 0 11-19-2008 11:54 PM
how to delete last number/word of a file and incude file count at the end of the chennaiguy Linux - Newbie 2 02-18-2008 09:08 PM
Don't know why file downloads quit before they're done royeo Linux - Newbie 3 12-07-2006 07:43 PM
cat file but don't quit Ephracis Linux - Software 2 08-26-2006 12:56 AM
Mplayer; quit at end of movie hamish Linux - Software 4 04-19-2006 01:14 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration