Hacker News new | ask | show | jobs
by hluska 4818 days ago
Or alternately, the solution is to paste it into your terminal, then take the time to read over what you pasted and make sure you understand what is going to happen before you hit enter. This is doubly important if the first word is 'sudo'!!

Not only is this a good habit as far as security goes, it's also the best way I can think of to learn from problems.

3 comments

This isn't a solution--this is exactly the dangerous behavior that this webpage is trying to convince you not to do.

Because they can put a newline in the malicious paste.

If the text contains a newline the command[1] will be executed immediately so that won't protect you.

[1]: At least, in the terminals I regularly use.

There was a newline hidden in the one pasted here, so that's not an option. It would have run something no matter what.