What does :(){ :|:& };: do? [duplicate]
What does this do: :(){ :|:& };:
.
I was reading through encyclopedia dramatica and saw that command.
It just being above rm -rf / --a-flag-we-don't-mention-here
makes me anxious about trying it out to see. Any insights on what it might be? I tried googling but to symboles make it impossible to search.
In fact what you posted there is called a fork bomb, because it does exactly that. It is a Bash function which calls itself recursively. You can replace the :
with a name if you want so it becomes more obvious:
fu {
fu | fu &
}; fu
So fu
calls itself, piping its output through itself again. In this way it fills up your processor with requests.
It is not harmful, beside the fact that you may have to reboot your computer the hard way because it becomes unresponsive.
It is often used by sysadmin to test user process limitations on a server.