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 09-14-2008, 04:28 PM   #1
LQ Newbie
Registered: Jun 2008
Posts: 19

Rep: Reputation: 0
how do I stop a shell terminal?

OK so im using the linux shell, but sometimes i run a program, and it keeps outputting to the terminal.

How do I stop it without exiting the current terminal?

I have tryed Esc key but it enters ^[ into the window!

Old 09-14-2008, 04:31 PM   #2
Senior Member
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Send stdout and stderr to /dev/null:

./myprogram 2>/dev/null 1>&2
Old 09-14-2008, 04:32 PM   #3
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Standard terminal bindings are:

Control-C: kill foreground process
Control-Z: Stop foreground process
Control-S: Suspend output from foreground process
Control-Q: Resume output from foreground process

There is also a flush output binding, but doesn't work reliably.


stty -a
bind -p
man stty # TTY driver key bindings
man bash # search for readline key bindings
Old 09-14-2008, 04:32 PM   #4
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 69
Ctrl+C should work. It's the Ctrl and the c keys pressed together.
Old 09-14-2008, 04:34 PM   #5
LQ Newbie
Registered: Jun 2008
Posts: 19

Original Poster
Rep: Reputation: 0
ok cool, thanks very helpful.

still gettin used to all this linux stuff!
Old 09-14-2008, 04:36 PM   #6
LQ Newbie
Registered: Jun 2008
Posts: 19

Original Poster
Rep: Reputation: 0
ctrl C is perfect
Old 09-14-2008, 04:44 PM   #7
Registered: Aug 2008
Distribution: Slackware
Posts: 53

Rep: Reputation: 16
ctrl+z brings you back to shell, but program keeps on running. type "fg" (fore-ground) to bring it back again.
you can read up this:


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
LXer: Terminal functions for shell scripting with Shell Curses LXer Syndicated Linux News 0 03-26-2008 11:50 PM
stop gnome terminal from starting kafnir Linux - General 1 10-10-2007 12:20 PM
How to completely stop terminal output? stankelay Programming 6 08-20-2007 05:34 AM
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 03:02 AM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 11:37 AM > Forums > Linux Forums > Linux - Newbie

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

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