I went to do some stuff on my PC the other day to find that the cat had been sleeping with her paw on the “Print Screen” button. This button starts up a program that takes a screenshot and brings up a window asking where you want to save it.

Holding down a key keeps repeating the keypress, so as long as the key is held down it’ll keep starting up new copies of the program, again and again and again, as fast as it can.   It is the PC equivalent of sitting stationary in your car with your foot firmly pressed down on the accelerator. The cat had been sitting like that for quite a long time.  Everything had ground to a halt and the status bar was just 1 pixel wide grey stripes. There was a black box on the screen where the last “take a screenshot” window had popped up but the poor PC didn’t have enough CPU left to actually fill it with anything.

The mouse was barely moving so there was no hope of actually using it to close the windows. It was time to use Geek powers and drop to the command line. I hit CTRL-ALT-F2 and waited for a while. Several seconds later the terminal came up and although it took a few seconds for each keypress to register, after a couple of minutes I was actually able to log in. An incantation of “ps -ef |wc -l” showed there were 3,600 processes running. Each screenshot capture takes 3 processes, so there were 1,200 screenshot programs running simultaneously. I gave it some Linux magic – “killall gnome-screenshot” and everything instantly sped up. I did some more killing and everything went back to normal – in fact there were no ill effects whatsoever and the computer worked fine for the rest of the day, with no need for a reboot or anything.

Jimbo once started up 140 text editors which barely slowed the PC down and Luna couldn’t kill it with 1,200 screenshot programs. Linux – impervious to cats and kids.

Update: It’s been pointed out that I should have used “pkill” rather than “killall”.  Killalling, while relatively harmless on a Linux box – a bit like trimming a dog’s claws, is the Unix equivalent of taking it out back and shooting it in the head with a rocket propelled grenade.

One Response