Ubuntu – How to kill 1 gnome-terminal window

gnome-terminallinuxUbuntu

Why in the world do all my gnome terminals run under 1 process in Ubuntu? This is integrating things that should remain separated! I much prefer xterm's rational mode of running one process per window.

I tried to switch some auto-started windows from xterm to gnome-terminal so I can freeze a log file from scrolling while I'm looking at it. Unfortunately, I can no longer kill my log windows that are littering my desktop. Just accidentally killed every terminal I had open!!!

  1. Can I kill individual gnome-terminal windows as if they are single shell processes? (you know, like a normal process)
    OR
  2. Can I stop auto-scrolling of tail -f inside an xterm by manually scrolling up, so I can read the log file while it's growing?

Best Answer

To get rid of a single window, use its close button. Or find out the process ID of the program running inside it, and kill it.

All unix terminals have a feature from way back when a terminal was a piece of hardware connected to the computer via a serial port. The terminal could send flow control commands to the computer: “XON” (meaning “stop sending me stuff, I'm not ready”) and “XOFF” (meaning “ok, throw me what you've got”). I normally recommend turning these features off in your terminal configuration (the command is stty -ixon), but in this particular case, they're useful: press Ctrl+S to stop scrolling, and Ctrl+Q to resume.

tail -f isn't the best way to read log files. Try out multitail, which is tail -f with coloring, filters, multiple windows and other stuff. Even if all you want to do is tail one file, run less +F, which turns on less's tail mode. Press Ctrl+C to switch to browsing and F to switch back to tailing.

Related Question