Secret command

Hi everebody!

Somebody tell me what this command does?

: ( ) {   : | : &   } ; :

Attention: do not execute this command 'cause your machine crash down!

Thanks a lot.

comand I have tried but give error

Sorry, I forget to said that I have ran in bash.

:() { something }
is attempting to define a function called ":". Not every shell is going to tolerate a function by that name.

it's a bit interesting that this works:

$ x() { echo hello & } ; x
hello
[1] 5548
[1] + Done                 echo hello
$
$

I guess the ampersand is doing double duty by backgrounding the command and introducing the start of a command. Usually I would expect:
x() { echo hello & ; }
to be correct. As you can see the end of the command simple invokes the function that was defined.

Where you get into trouble is that the function then invokes itself twice. This winds up trying to run an infinite number of processes. It can't, but it runs as much as it can and will keep this up forever.

The part I don't get is : - it evaluates to "true" in most contexts.

:
is a command that happens to do the equivalent of
exit 0
It is a built-in command so it is very fast. But many built-in commands can be refined with a function definition. In bash, you can define a new version of : if you want.

Thank you everybody for your explanation.