2

I was installing a .iso 8,2 version in a vmware to learn unix., and i am stuck with iostat command, i run iostat 3 and is keep going to show me the results, but whem i put exit or q or q! to exit, he not want to go out from iostat 3.

pstnc
  • 35
  • 1
    SIGINT, SIGTERM, SIGKILL are always work. ;) – vakufo Mar 09 '12 at 11:56
  • I try with the 3 commands and is not working :( http://imageshack.us/photo/my-images/192/errorunix.png/ – pstnc Mar 09 '12 at 12:01
  • 1
    You tried to write the signals to the console where iostat ran. This won't ever work. Those signals needed to be sent outside from the application to be stopped. The default command is kill. Don't be afraid from the word 'kill', it has got options which don't stop (or even kill) the application. (sorry if it is chaotic, my English could be better) – vakufo Mar 09 '12 at 12:21
  • @vakufo your english is very good, and i'm sorry but i'm a newbie in this, thank anyway for your time., bye – pstnc Mar 09 '12 at 13:35

1 Answers1

11

As @vakufo said, have you tried sending it an appropriate signal? Some of the more useful ones can be issued from a terminal keyboard: Ctrl-C and Ctrl\ issue two of the more standard ones. The former is nicer than the latter.

Or you could use job control: Ctrl-Z, then type kill %%.

Or you could switch to another virtual console and type kill PID, where PID is the process ID of the iostat process, which you can find with ps. Or, if you know you only have one running, just say pkill iostat. It's been a while since I last ran one of my BSDs, I can't remember if they have pkill (it's there on Solaris and recent Linux distributions).

A Unix tutorial will cover all of these, by the way.

Is Your Terminal Paused?

Also, if things aren't responding, you may want to consider pressing Ctrl-Q. It could be that you inadvertently pressed Ctrl-S, which stops output to the terminal (as per XON/XOFF, aka software flow control — this works on a virtual terminal too, as well as on most X11 terminal emulators, not just serial ports). You may have already quit the program, but with terminal output paused you'd never know. On the Linux console (the white-on-black text-only thing you boot into before X), the keyboard Scroll Lock light illuminates when this mode is active. Can't remember what the BSDs do, if anything.

Feel free to read more information about this feature here. It's a common thing among beginners to freeze a TTY. I still do it by mistake, so I've developed a reflex to unpause the terminal if characters aren't echoing.

Alexios
  • 19,157
  • great answer Alexios, many thanks .. and trust me i have open +10 tabs in browser to find this solution and nothing! is working with the first command Ctrl+C – pstnc Mar 09 '12 at 12:12
  • No problem! You should get familiar with the Unix terminal emulators early, by the way. It has many traps (and many nice features). And in the unlikely case you ever encounter real hardware terminals, you'll know how to use them. :) – Alexios Mar 09 '12 at 12:16
  • iostat seems to ignore Ctrl-C in some terminals & environments. I noticed that this is reproducible on CoreOS using this docker image: chriswayg/toolbox with the toolbox command. However, if you install tmux and use it (apk update && apk add tmux && tmux, then run iostat -xk 5), Ctrl-C does work! In the default CoreOS toolbox shell environment, something is catching Ctrl-C first or blocking iostat from getting it! – TrinitronX Nov 10 '17 at 21:56