How can I stop cat output immediately despite massive output?


I'm looking for someway to stop the output to STDOUT when I realize a command is wrong. For instance, if I accidentally cat a very large file. Usually it will eventually stop if you hold down ctrl + c, but it takes a long time.

Is there a way to stop the output more immediately?


Answers:


You can run ctl-z to background it and then kill the PID.

$ ctl z (to background it)

$ kill -9 {pid} 'of process that just got backgrounded'