1

My terminal is becoming unresponsive after I typed below incorrect command.I am using putty Release 0.70 to ssh to Centos7. Why is the terminal unresponsive ?

 $ yes "abc" /dev/null &  

I know I forgot redirection operator '>' but I don't understand why is the terminal not responding to ^C or ^Z ?

2

Your process runs in background. Ctrl+C and Ctrl+Z have no effect on it.

Try typing fg Enter and then Ctrl+C or Ctrl+Z. fg brings the process to the foreground.

You do not see the effect of Ctrl+C and Ctrl+Z in your terminal because it scrolls too fast.

| improve this answer | |
  • 1
    You beat me to it. The alternative way to recover is typing kill %. – Kamil Maciorowski Sep 28 '17 at 23:24
  • That's three more keys combinations to hit ! ;-) . – le_top Sep 28 '17 at 23:26
  • That explains it. so the argument(s) "abc" /dev/null is treated as a single argument to the yes cmd. – RKA Sep 29 '17 at 2:02
  • thx @le_top and @Kamil Maciorowski! That explains it. so the argument(s) "abc" /dev/null is treated as a single argument to the yes cmd. But when I tried typing fg Enter and then Ctrl+C it has no effect. – RKA Sep 29 '17 at 2:11
  • 1
    @RaviKumar Maybe you had typed some characters before, so your command became e.g. abc11fg. Hit Ctrl+C to clear the command line and try again. Also note the solution requires your yes to be the current job. It is for sure if it's the only job; but if there's another job that used to be in the foreground, this may be the current job. If there's no other yes process you want to keep then try killall yes, this does not depend on jobs. – Kamil Maciorowski Sep 29 '17 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.