Hiding Commands

Copy and pasting this command into a console will print a hidden line. It works in both bash and powershell.

echo "";
echo "hidden command";
echo
"hello"

If it's copy and pasted into a text editor you can see the additional lines it contains:

echo ""; echo "hidden command"; echo "hello"

This trick works by hiding the additional lines using CSS. Because the hidden lines end in line breaks, they will be executed as soon as they are pasted into a console - without warning the user. The hidden lines are also inserted between echo and "hello" to ensure that the user copies all of them. If the hidden lines were inserted at the very beginning or end of the command, the user might not copy them.