Looking for a specific line in the production server's /etc/password with this command:
sed -i -n '/foobar/p' /etc/passwd
trimmed the file to a single line's length. D'oh! Shouldn't have added that `-i`, should not have done that.
Luckily I could restore it from a (working) backup while still logged in. Phew!